#hi
1 messages · Page 1 of 1 (latest)
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
If you know for sure that the channel is TextChannel just use
const channel = guild?.channels.cache.get(bugReportChannelId) as TextChannel;
there's your answer @haughty knot
i didn't even notice you didn't make the thread...
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
could you try fetching the threads first? threads.fetch()
you don't need any additional intents, GUILDS is enough for it
I already tried :/
and what happened?
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);
}
if (channel.type === 'GUILD_TEXT') {
const threads = await channel.threads.fetch();
console.log('Channel name', channel.name);
console.log('Channel threads size', threads.cache.size);
}
Try this
Sorry guys, the problem was with the permissions inside the Server
The bot was not "seeing" the channel
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!
Add the bot to the channel it works, I don't need to fetch, only the archiveds