Is sapphire framework supposed to assign command id to every command whether it is global or guild-only? also, can we put idHints directly in the slash commands or not? if not, what do you suggest
Solution
first question is a yes because that's just how the Discord API works (as well as databases in general for that matter). Every entity has an id. A message (like this), a user, a guild (server), channel, thread, forum post, etc, they all have ids.
For your second question, I'm not exactly sure what you're asking. There is only 1 valid place to put the
idHints
idHints
and that's as part of the
registerChatInputCommand
registerChatInputCommand
/
registerContextMenuCommand
registerContextMenuCommand
function's second paramater (options)
public override registerApplicationCommands(registry: Command.Registry) { registry.registerChatInputCommand((builder) => builder // .setName(this.name) .setDescription(this.description) .addUserOption((option) => option // .setName('user') .setDescription('User to say hello to') .setRequired(true) ) , { idHints: ['they go here'] }); }
public override registerApplicationCommands(registry: Command.Registry) { registry.registerChatInputCommand((builder) => builder // .setName(this.name) .setDescription(this.description) .addUserOption((option) => option // .setName('user') .setDescription('User to say hello to') .setRequired(true) ) , { idHints: ['they go here'] }); }