How to specify the ID of a forum channel?
I have an app that sends messages to a database if they are in the pre-approved channel. I'm using the code below. This works fine when the message comes from a regular channel, but not a forum channel. Should
channel.id
be something else for forum channels?
if (allowedChannels.some(channel => channel.channel_id === message.channel.id))
4 Replies
• What's your exact discord.js
npm list discord.js
and node node -v
version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.ThreadChannel
has an id
property which is the thread channel's id, and I believe it also has a parennt
property which contains the forum channel's id for which the thread is a child of
So, when a message is sent in a thread channel, you're looking for;
- channel.id
- thread channel ID
- channel.parent.id
- forum channel IDThat did it! Thank you very much
Pleasure