JS Problems with global Slash commands in DMs

Can someone help me with this? I have some global commands that appear on any server without the bot being added there, but they don't appear in people's DMs. I'm using the latest versions of discord.js and nodejs, the commands are separated from their Index.js and it logs them correctly instantly, but they don't appear in the DMs.:crySparkle:
10 Replies
d.js toolkit
d.js toolkit5mo 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!
d.js docs
d.js docs5mo ago
:method: SlashCommandBuilder#setContexts() discord.js@14.21.0 Sets the contexts of this command.
chewie
chewie5mo ago
you need to set the proper contexts, including private dm
Kexour
KexourOP5mo ago
I have the: setDMPermission(true)
chewie
chewie5mo ago
thats not the correct way, no
Kexour
KexourOP5mo ago
Oh So that was the problem?
chewie
chewie5mo ago
yes
Kexour
KexourOP5mo ago
So: setContexts(['Guild', 'BotDM'])? Or how would it be, can you give me an example?
chewie
chewie5mo ago
discord.js Guide
Imagine a guide... that explores the many possibilities for your discord.js bot.
Kexour
KexourOP5mo ago
I just understood and it works now, thanks

Did you find this page helpful?