Bot in GC

How do I get my bot to work within both servers and group chats? It was working before but after I changed smth (I forget what) it's slash commands don't work in dms or group chats anymore
10 Replies
d.js toolkit
d.js toolkit2w ago
- 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 OP
鸭神🐤
鸭神🐤OP2w ago
discord.js is 14.16.3 node is 20.17.0
d.js docs
d.js docs2w ago
:method: SlashCommandBuilder#setContexts() @1.9.0 Sets the contexts of this command.
Mark
Mark2w ago
use the InteractionContextType.BotDM context
鸭神🐤
鸭神🐤OP2w ago
Would I be able to do BotDM, Guild, and Private Channel or am I only able to pick one?
鸭神🐤
鸭神🐤OP2w ago
discord.js
discord.js
discord.js is a powerful Node.js module that allows you to interact with the Discord API very easily. It takes a much more object-oriented approach than most other JS Discord libraries, making your bot's code significantly tidier and easier to comprehend.
Mark
Mark2w ago
oh it's PrivateChannel mb, but you can set any or all of them
鸭神🐤
鸭神🐤OP2w ago
How would I do this?
Mark
Mark2w ago
by passing the desired ones to the setContexts method
鸭神🐤
鸭神🐤OP2w ago
Thanks! It works now!
Want results from more Discord servers?
Add your server