Add ContextMenuCommandBuilder support (and more!)
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 asbold
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 usingOption.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)
.