reformatted to use my template
This commit is contained in:
50
src/rolemanager/slash.ts
Normal file
50
src/rolemanager/slash.ts
Normal 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)
|
||||
|
||||
]);
|
||||
}
|
||||
Reference in New Issue
Block a user