Send to specific channel
I used the docs To get "const channel = client.channels.cache.get('1153350608082964592');" but I get this error. Any help? Looked around and to no avail.
5 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!
- ✅
Marked as resolved by OPlooks like you didn't require discord.js properly to define Discord.
With code like that I'd expect the first line of your code to be smth like
const Discord = require('discord.js')
I would recommend going through a formal guide to understand things properly, https://discordjs.guide/Did have that
That's the thing on why I was confused. It was in a commands file - suggestion.js
if you did it wouldn't say that
Discord is not defined
so I would recommend you double check you do have that in the file you are working in
or that you pass it or what not
also if this is in a command file you 100% should not be redefining a client variable
you would want to pass along the existing (logged in) client value through whatever command handler system you are usingGot it thanks