Skip to content

Commit 308ed5e

Browse files
committed
Revise ExampleCommand file to fit new framework
1 parent 70100e7 commit 308ed5e

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

examples/ExampleCommand.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
2-
import { Message } from 'discord.js';
1+
import { SlashCommandBuilder } from '@discordjs/builders';
2+
import { CommandInteraction, Message } from 'discord.js';
33
import Command from '../Command';
44
import { BotClient } from '../types';
55

@@ -8,17 +8,20 @@ import { BotClient } from '../types';
88
*/
99
export default class ExampleCommand extends Command {
1010
constructor(client: BotClient) {
11+
const definition = new SlashCommandBuilder()
12+
.setName('example')
13+
.setDescription('Does something.');
1114
super(client, {
1215
name: 'example',
1316
enabled: true,
1417
description: 'Does something.',
1518
category: 'Uncategorized',
1619
usage: client.settings.prefix.concat('example'),
1720
requiredPermissions: ['SEND_MESSAGES'],
18-
});
21+
}, definition);
1922
}
2023

21-
public async run(message: Message): Promise<void> {
22-
await super.respond(message.channel, 'Whoop!');
24+
public async run(interaction: CommandInteraction): Promise<void> {
25+
await super.respond(interaction, 'Whoop!');
2326
}
2427
}

0 commit comments

Comments
 (0)