Is there a way to make global app commands (/) only work via DMs?
I know how to prevent global commands from showing up in DMs but I'm wanting the other way around.
13 Replies
• What's your exact discord.js
npm list discord.js
and node node -v
version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.No, it's not possible
You would have to deploy them globally, then manually
return
if the channel is not DM-basedAlright ty
If I wanted to exclude 2 commands from only being able to run via DMs (meaning they can be ran in a guild) this would be the correct code, right?
Cause it is not working. I tried running
/ping
and it is still saying that the command can only be ran via DMs.
These would be the only 2 commands.Isnt
dmCommand
always going to be truthyI removed that and attempted again and same thing.
So what is
dmCommand
here?That is all of my slash commands that I only want to be run in DMs
So its an array?
Yes
ping me whenever someone has an idea. thanks in advance.
Well arrays don't have properties like that. I'm not sure what you're attempting anymore. Would need to see far more surrounding code for context @dudethatserin
I’m trying to make it so only the
ping
and invite
commands can be used in guilds where other global application commands can only be used in DMs. https://github.com/DudeThatsErin/Omnivore-Bot/blob/main/index.js this is my entire index.js file. Bot is going to be open source.I'd just check interaction.commandName
And if it's one of those two, let it be used
Alright I’ll try that