Bot user interaction

Discord added user interaction, so slash commands can be use in any place, even in dms with other people. Does discord.js supports it?
No description
3 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! - Marked as resolved by OP
monbrey
monbrey5mo ago
SlashCommandBuilders dont support setting commands for user interaction contexts yet But if you add the additional properties to the JSON, discord.js can still receive and respond to commands from user contexts There's a couple of known issues with things like Group DMs pending a fix
nielot
nielotOP5mo ago
So, this is the place to add this properties? In command file? For example, what should i add to ping command?
module.exports = {
data: new SlashCommandBuilder()
.setName('ping')
.setDescription('Replies with Pong!'),
async execute(interaction) {
await interaction.reply('Pong!');
},
};
module.exports = {
data: new SlashCommandBuilder()
.setName('ping')
.setDescription('Replies with Pong!'),
async execute(interaction) {
await interaction.reply('Pong!');
},
};
k, i got it
Want results from more Discord servers?
Add your server