Channel is not found ?
hello i have a probleme a little probleme
i want to send a message in a channel when someone rank up
but the channel is not found im sure 100% i put the right ID
so why he cant find the channel ?
8 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!
my terminal i have this
any idea where i messed up ?
first of all if you have the guilds intent you shouldnt really need to fetch channels (at lesst text channels) because they will be cached on ready
are you doing this inside an event?
is you bot logged in when you try to fetch this channel?
oh okay
I see the issue
you are comparing the channel type to a string but it has to be a number now OR I think ("GuildText") could work too, not entirely sure about the last one so my suggestion is:
Import ChannelType from discord.js and check channel.type === ChannelType.GuildText instead
yea no im pretty sure strings dont work here anymore
like this ?
maybe i didnt put "guildtext"
i did tell you exactly how it was, its pascal case not screaming case now
GuildText
all good, just try again
oh and also the enum is ChannelType not ChannelTypes
oh yeah you were right its working now
thx you so much
glad i could