How can I send a message to this channel?
Hey, how can I send a message to this channel?
2 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!Because channel is undefined, i see you have defined channelId as a number, make it a string
Discordjs uses string for snowflakes
Also, you are getting the channel from the newly joined guild, but you are passing a pre defined id, that doesn't make sense, since how do you know the id of a channel in a guild your bot has not yet joined (unless this is for testing purposes), but still you should get it from the
<Client>.channels.cache