Skip to content

Commit

Permalink
feat(SlashCommand): add getMention
Browse files Browse the repository at this point in the history
  • Loading branch information
Snazzah committed Sep 4, 2024
1 parent 0cd3178 commit 3e4c9fc
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,15 @@ export class SlashCommand<T = any> {
};
}

/**
* Get a string that mentions the user. Retuens null if the ID is not collected.
*/
getMention(guild?: string) {
const id = this.ids.get(guild || 'global');
if (!id) return null;
return `</${this.commandName}:${id}>`;
}

/**
* The internal key name for the command.
* @private
Expand Down

0 comments on commit 3e4c9fc

Please sign in to comment.