-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtranslate-command.ts
26 lines (23 loc) · 1.07 KB
/
translate-command.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import { ApplicationCommandData, CommandInteraction, PermissionString } from 'discord.js';
import { LangCode, Language } from '../models/enums';
import { EventData } from '../models/internal-models';
import { Lang } from '../services';
import { MessageUtils } from '../utils';
import { Command } from './command';
export class TranslateCommand implements Command {
public metadata: ApplicationCommandData = {
name: Lang.getCom('commands.translate'),
description: Lang.getRef('commandDescs.translate', Lang.Default),
};
public requireDev = false;
public requireGuild = false;
public requireClientPerms: PermissionString[] = [];
public requireUserPerms: PermissionString[] = [];
public async execute(intr: CommandInteraction, data: EventData): Promise<void> {
let embed = Lang.getEmbed('displayEmbeds.translate', data.lang());
for (let langCode of Object.values(LangCode)) {
embed.addField(Language.displayName(langCode), Language.translators(langCode));
}
await MessageUtils.sendIntr(intr, embed);
}
}