#List all channels in v14
5 messages · Page 1 of 1 (latest)
`-- [email protected]
node: v18.13.0
const textChannels = this.interaction.message.guild.channels.cache.filter((channel) => channel.type === 'text');
textChannels.forEach((channel) => console.log(channel.name));
There is no error, but it's just empty array even that I have channels
Types are not strings; they're enum members
Instead of using method-based type guard functions, you can narrow channel types with the .type property
- channel.isText()
+ channel.type === ChannelType.GuildText