discord-reaction-award/src/commands.ts

84 lines
2.6 KiB
TypeScript

import { SlashCommandBuilder, SlashCommandSubcommandBuilder } from '@discordjs/builders';
const output = new SlashCommandSubcommandBuilder()
.setName('output')
.setDescription('Set the output channel')
.addChannelOption(option =>
option.setName('channel')
.setDescription('The channel to send messages to')
.setRequired(true));
const channels = new SlashCommandSubcommandBuilder()
.setName('channels')
.setDescription('Configure channel list')
.addStringOption(option =>
option.setName('add_remove')
.setDescription('add_remove')
.setRequired(true)
.addChoices(
{ name: 'Add', value: 'add' },
{ name: 'Remove', value: 'remove' }
))
.addChannelOption(option =>
option.setName('channel')
.setDescription('The channel to list')
.setRequired(true));
const channels_type = new SlashCommandSubcommandBuilder()
.setName('channels_type')
.setDescription('Set the channel list type')
.addStringOption(option =>
option.setName('channels_type')
.setDescription('include or exclude')
.setRequired(true)
.addChoices(
{ name: 'Include', value: 'include' },
{ name: 'Exclude', value: 'exclude' }
));
const emojis = new SlashCommandSubcommandBuilder()
.setName('emojis')
.setDescription('Configure emoji list')
.addStringOption(option =>
option.setName('add_remove')
.setDescription('add_remove')
.setRequired(true)
.addChoices(
{ name: 'Add', value: 'add' },
{ name: 'Remove', value: 'remove' }
))
.addStringOption(option =>
option.setName('emoji')
.setDescription('The emoji to list')
.setRequired(true));
const emojis_type = new SlashCommandSubcommandBuilder()
.setName('emojis_type')
.setDescription('Set the emoji list type')
.addStringOption(option =>
option.setName('emojis_type')
.setDescription('include or exclude')
.setRequired(true)
.addChoices(
{ name: 'Include', value: 'include' },
{ name: 'Exclude', value: 'exclude' }
));
const score = new SlashCommandSubcommandBuilder()
.setName('score')
.setDescription('Set the number of scores to trigger')
.addIntegerOption(option =>
option.setName('score')
.setDescription('The number of scores to trigger')
.setRequired(true));
const config = new SlashCommandBuilder()
.setName('config')
.setDescription('Configure the bot')
.addSubcommand(output)
.addSubcommand(channels)
.addSubcommand(channels_type)
.addSubcommand(emojis)
.addSubcommand(emojis_type)
.addSubcommand(score);
const commands = [config];
export default commands;