reformatted to use my template

This commit is contained in:
2022-03-31 15:04:54 -05:00
parent a9ea7bf8d5
commit 7bac005fe7
32 changed files with 8222 additions and 783 deletions

50
src/rolemanager/slash.ts Normal file
View File

@@ -0,0 +1,50 @@
import { addCommand, CommandGenerator, CommandOptionGenerator, OptionChoices } from 'discordslash';
import { InteractionRoles } from './data';
import Lang from 'lang';
import { RolesAllCommand, RolesCommand } from './commands';
export function initSlash() {
const Categories: OptionChoices[] = InteractionRoles.map((opt, i) => ({
name: opt.message,
value: i
}));
addCommand([
//roles ======
new CommandGenerator()
.setName('roles')
.setDescription(Lang.get('command.roles.description.command'))
.addOption([
new CommandOptionGenerator()
.setName('category')
.setType('string')
.setDescription(Lang.get('commands.roles.categorydescription.category'))
.addChoice(Categories)
.setRequired()
])
.setRun(RolesCommand),
//rolesall ======
new CommandGenerator()
.setName('rolesall')
.setDescription(Lang.get('command.rolesall.description.command'))
.addOption([
new CommandOptionGenerator()
.setName('category')
.setDescription(Lang.get('command.rolesall.description.category'))
.addChoice(Categories),
new CommandOptionGenerator()
.setName('channel')
.setDescription(Lang.get('command.rolesall.description.command'))
])
.setRun(RolesAllCommand)
]);
}