#hi

1 messages · Page 1 of 1 (latest)

celest gale
rotund kraken
#

well it returns all the text based types
like not just a TextChannel
and this has been changed in v14
now it would work like so
isText() -> narrows to TextChannel
isTextBased() -> narrows to Text-Based Channels

dusty zealot
#

If you know for sure that the channel is TextChannel just use
const channel = guild?.channels.cache.get(bugReportChannelId) as TextChannel;

rotund kraken
#

there's your answer @haughty knot
i didn't even notice you didn't make the thread...

haughty knot
#

Thanks a lot, @rotund kraken ! And sorry for not open a thread

#

@rotund kraken I am getting channel.threads.cache.size iquals to 0, I have to pass some intents to get the threads?

#

The channel has threads

rotund kraken
#

you don't need any additional intents, GUILDS is enough for it

haughty knot
rotund kraken
#

and what happened?

haughty knot
#

Get size as 0

#
if (channel.type === 'GUILD_TEXT') {
  await channel.threads.fetch();

  console.log('Channel name', channel.name);
  console.log('Channel threads size', channel.threads.cache.size);
}
dusty zealot
haughty knot
#

Sorry guys, the problem was with the permissions inside the Server

#

The bot was not "seeing" the channel

dusty zealot
#

I dont know much about thread caching system but I believe it should still see it even if it has no perms, but if it is solved for you then thats great!

haughty knot
#

Add the bot to the channel it works, I don't need to fetch, only the archiveds