Can't send message to specific channels
In my ClientReady event. I can send a message to specific channel
but it seems not to work with this slash command
it throws:
Cannot read properties of undefined (reading 'channels')11 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 OPshow the full code of your ready event listener
because
client is apparently undefined according to your errorhere
and how do you register your event listeners? what's the handler?
I'm using the one that on the document
does that line show up in your console?
yes it does
post the full error you receive including stack
at Object.execute (d:\Works\Discord Bots\abith\src\commands\moderation\kick.js:143:52)not anywhere close to your ready listener. please pay attention to your errors, they have a lot of useful information
thank you. I found the solution now.
I just have to add
interaction. before client