Commands won't show up in DMs

I cannot for the LIFE of me get commands from my bot to show up in dms with other users.
9 Replies
d.js toolkit
d.js toolkit2d 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!
Lumii
LumiiOP2d ago
// ADD: New "Gif-ify Image" Message Context Menu Command
const gififyMessageCommand = new ContextMenuCommandBuilder()
.setName('Gif-ify Image')
.setType(ApplicationCommandType.Message); // Specify it's a Message context menu command

const commands = [
setupCommand.toJSON(),
resetCommand.toJSON(), // Add the reset command here
gififyMessageCommand.toJSON() // Add the new Message Context Menu command
];
// ADD: New "Gif-ify Image" Message Context Menu Command
const gififyMessageCommand = new ContextMenuCommandBuilder()
.setName('Gif-ify Image')
.setType(ApplicationCommandType.Message); // Specify it's a Message context menu command

const commands = [
setupCommand.toJSON(),
resetCommand.toJSON(), // Add the reset command here
gififyMessageCommand.toJSON() // Add the new Message Context Menu command
];
npm node -v returns 9.2.0 npm list discord.js returns 14.19.3
Lumii
LumiiOP2d ago
Here's an example of what my application does.
No description
FCH Toolkit
FCH Toolkit2d ago
No description
Lumii
LumiiOP2d ago
It takes an image and changes its file extension to .gif so that it can be saved in the discord gif favorites folder easily.
d.js docs
d.js docs2d ago
:method: ContextMenuCommandBuilder#setContexts() [email protected] Sets the contexts of this command.
Lumii
LumiiOP2d ago
It shows up in my dms with the bot but not other users. Oh! Let me check..
const gififyMessageCommand = new ContextMenuCommandBuilder()
.setName('Gif-ify Image')
.setType(ApplicationCommandType.Message) // Specify it's a Message context menu command
.setContexts([InteractionContextType.Guild, InteractionContextType.BotDM, InteractionContextType.PrivateChannel])
.setIntegrationTypes([IntegrationType.GuildInstall, IntegrationType.UserInstall]);

const commands = [
setupCommand.toJSON(),
resetCommand.toJSON(), // Add the reset command here
gififyMessageCommand.toJSON() // Add the new Message Context Menu command
];
const gififyMessageCommand = new ContextMenuCommandBuilder()
.setName('Gif-ify Image')
.setType(ApplicationCommandType.Message) // Specify it's a Message context menu command
.setContexts([InteractionContextType.Guild, InteractionContextType.BotDM, InteractionContextType.PrivateChannel])
.setIntegrationTypes([IntegrationType.GuildInstall, IntegrationType.UserInstall]);

const commands = [
setupCommand.toJSON(),
resetCommand.toJSON(), // Add the reset command here
gififyMessageCommand.toJSON() // Add the new Message Context Menu command
];
Like this? I updated it with this code and restarted my discord, but it still isn't working in dms with others. This application is also a bot that runs in a couple servers, so I'm also wondering if that could be causing interference? Oh, actually, it's because my bot has stopped working entirely - it's crashing on startup
5|discord_core | [DIAGNOSTIC] Detected discord.js version: 14.19.3
5|discord_core | [DIAGNOSTIC] Type of IntegrationType: undefined
5|discord_core | TypeError: Cannot read properties of undefined (reading 'GuildInstall')
5|discord_core | at Object.<anonymous> (/home/fchuser/discordbackend/core.js:52:47)
5|discord_core | at Module._compile (node:internal/modules/cjs/loader:1356:14)
5|discord_core | at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
5|discord_core | at Module.load (node:internal/modules/cjs/loader:1197:32)
5|discord_core | at Module._load (node:internal/modules/cjs/loader:1013:12)
5|discord_core | at Object.<anonymous> (/usr/local/lib/node_modules/pm2/lib/ProcessContainerFork.js:33:23)
5|discord_core | at Module._compile (node:internal/modules/cjs/loader:1356:14)
5|discord_core | at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
5|discord_core | at Module.load (node:internal/modules/cjs/loader:1197:32)
5|discord_core | at Module._load (node:internal/modules/cjs/loader:1013:12)
5|discord_core | [DIAGNOSTIC] Detected discord.js version: 14.19.3
5|discord_core | [DIAGNOSTIC] Type of IntegrationType: undefined
5|discord_core | TypeError: Cannot read properties of undefined (reading 'GuildInstall')
5|discord_core | at Object.<anonymous> (/home/fchuser/discordbackend/core.js:52:47)
5|discord_core | at Module._compile (node:internal/modules/cjs/loader:1356:14)
5|discord_core | at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
5|discord_core | at Module.load (node:internal/modules/cjs/loader:1197:32)
5|discord_core | at Module._load (node:internal/modules/cjs/loader:1013:12)
5|discord_core | at Object.<anonymous> (/usr/local/lib/node_modules/pm2/lib/ProcessContainerFork.js:33:23)
5|discord_core | at Module._compile (node:internal/modules/cjs/loader:1356:14)
5|discord_core | at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
5|discord_core | at Module.load (node:internal/modules/cjs/loader:1197:32)
5|discord_core | at Module._load (node:internal/modules/cjs/loader:1013:12)
Lumii
LumiiOP2d ago
Well, I couldn't figure out how to fix this or w/e, but deleting that line of code fixed it and it started working! It Just Works...

Did you find this page helpful?