You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
654 B
26 lines
654 B
2 years ago
|
import { SlashCommand, CommandOptionType, SlashCreator, CommandContext } from 'slash-create';
|
||
|
|
||
|
export default class BotCommand extends SlashCommand {
|
||
|
constructor(creator: SlashCreator) {
|
||
|
super(creator, {
|
||
|
name: 'hello',
|
||
|
description: 'Says hello to you.',
|
||
|
options: [
|
||
|
{
|
||
|
type: CommandOptionType.STRING,
|
||
|
name: 'food',
|
||
|
description: 'What food do you like?'
|
||
|
}
|
||
|
]
|
||
|
});
|
||
|
|
||
|
creator.registerGlobalComponent("hi", (interact) => {
|
||
|
|
||
|
})
|
||
|
}
|
||
|
|
||
|
async run(ctx: CommandContext) {
|
||
|
return ctx.options.food ? `You like ${ctx.options.food}? Nice!` : `Hello, ${ctx.user.username}!`;
|
||
|
}
|
||
|
}
|