#Bot user interaction

6 messages · Page 1 of 1 (latest)

oblique verge
#

Discord added user interaction, so slash commands can be use in any place, even in dms with other people. Does discord.js supports it?

thin fogBOT
#
  • What's your exact discord.js npm list discord.js and node node -v version?
  • Not a discord.js issue? Check out #1081585952654360687.
  • 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
azure geode
#

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

oblique verge
#

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!');
    },
};