Skip to content

Commit

Permalink
feat(command): have getMention support subcommands
Browse files Browse the repository at this point in the history
  • Loading branch information
Snazzah committed Sep 17, 2024
1 parent 979ec3d commit f1c8a6d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,13 @@ export class SlashCommand<T = any> {

/**
* Get a string that mentions the user. Retuens null if the ID is not collected.
* @param subcommands The subcommands to include in the mention.
* @param guild The guild to fetch the ID from.
*/
getMention(guild?: string) {
getMention(subcommands?: string, guild?: string) {
const id = this.ids.get(guild || 'global');
if (!id) return null;
return `</${this.commandName}:${id}>`;
return `</${this.commandName}${subcommands ? ` ${subcommands}` : ''}:${id}>`;
}

/**
Expand Down

0 comments on commit f1c8a6d

Please sign in to comment.