Trying to figure out why my user app doesn't work in direct messages.

Is there something that need to be enabled during command registration for user apps to work in dms? Is there something that needs to be enabled in the developer portal. Does it have to be a verified bot?
6 Replies
d.js toolkit
d.js toolkit3mo 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!
waraside
warasideOP3mo ago
ok I think I solved it... I think I need wait for global commands to update to know for sure https://discord.js.org/docs/packages/builders/main/ChatInputCommandBuilder:Class#setContexts
import { SlashCommandBuilder, InteractionContextType } from 'discord.js';

new SlashCommandBuilder()
.setContexts([
InteractionContextType.BotDM,
InteractionContextType.Guild,
InteractionContextType.PrivateChannel
])
.setName('help')
.setDescription('Gets help infomation.')
import { SlashCommandBuilder, InteractionContextType } from 'discord.js';

new SlashCommandBuilder()
.setContexts([
InteractionContextType.BotDM,
InteractionContextType.Guild,
InteractionContextType.PrivateChannel
])
.setName('help')
.setDescription('Gets help infomation.')
I think this is correct
Pulse
Pulse3mo ago
did you deploy them globally or within a guild? https://discordjs.guide/creating-your-bot/command-deployment.html#global-commands
Global application commands will be available in all the guilds your application has the applications.commands scope authorized in, and in direct messages by default.
waraside
warasideOP3mo ago
globally I know it can take a while to update globally
Pulse
Pulse3mo ago
its instant now, you just need to reload ctrl+R
waraside
warasideOP3mo ago
ok thanks it's working now

Did you find this page helpful?