import {Command, container} from "@sapphire/framework";
import {ChannelType} from "discord-api-types/v10";
class SalCommand extends Command {
constructor(context, options) {
super(context, {
...options,
name: 'sal',
subcommands: [
{
name: 'create-event',
chatInputRun: 'chatInputCreateEvent'
},
]
});
}
async chatInputCreateEvent(interaction, context) {
console.info('Creating Event');
const name = 'Event Name';
return interaction.reply({
content: `Your event, ${name}, has been created`
})
}
registerApplicationCommands(registry) {
registry.registerChatInputCommand((builder) =>
builder
.setName(this.name)
.setDescription('The root command')
.addSubcommand((builder) =>
builder
.setName('create-event')
.setDescription('Create a new Snakes and Ladders event')
.addChannelOption((option) =>
option
.setName('watch-channel')
.setDescription('The channel to watch for drops')
.setRequired(true)
.addChannelTypes(ChannelType.GuildText)
)
.addChannelOption((option) =>
option
.setName('message-channel')
.setDescription('The channel where update messages should be sent')
.setRequired(true)
.addChannelTypes(ChannelType.GuildText)
)
.addStringOption((option) =>
option
.setName('event-json')
.setDescription('The json representing the event')
.setRequired(true)
)
)
)
}
}
export {SalCommand};