Skip to content

Add ContextMenuCommandBuilder support (and more!)

Compare
Choose a tag to compare
@Mimickal Mimickal released this 12 Dec 02:11
· 80 commits to master since this release
bcfa123

A couple of nice additions here;

  • ContextMenuCommandBuilder builders can now be defined with command handlers.
    const {  ApplicationCommandType, SlashCommandRegistry } = require('discord-command-registry');
    new SlashCommandBuilder().addContextMenuCommand(command => command
      .setName('menu-option')
      .setType(ApplicationCommandType.Message)
      .setHandler(interaction => interaction.reply('selected something from the menu!'))
    )
  • @discordjs/builders defined utility methods, such as bold for dressing up messages. These are all now forwarded through this library, so they can be directly imported.
    const { bold } = require('discord-command-registry');
  • Add new option helper for Emojis. Like Options.getApplication(...), you use this by defining string option, then using Option.getEmoji(interaction, 'opt_name') in your handler.
  • Option resolvers now support an optional third required argument to be in line with the ones built into Discord.js. Like the built-in ones, these default to false. Example: Option.getEmoji(interaction, 'opt_name', true).