mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-02 06:28:54 +00:00
Slash command formatter
This commit is contained in:
1 file changed
+9
@@ -1,3 +1,5 @@
|
||||
import { TFunction } from 'i18next';
|
||||
|
||||
export function formatDuration(durationMs: number): string {
|
||||
const durationDate: Date = new Date(0);
|
||||
durationDate.setMilliseconds(durationMs);
|
||||
@@ -17,3 +19,10 @@ export function formatDuration(durationMs: number): string {
|
||||
return `${durationSeconds}s`;
|
||||
}
|
||||
}
|
||||
|
||||
export function formatSlashCommand(commandName: string, translator: TFunction): string {
|
||||
const translatedName = translator(`commands.${commandName}.metadata.name`, {
|
||||
defaultValue: commandName
|
||||
});
|
||||
return `**\`/${translatedName}\`**`;
|
||||
}
|
||||
Reference in new issue
Block a user