aboutsummaryrefslogtreecommitdiff
path: root/src/commands
diff options
context:
space:
mode:
authorMax Isom <[email protected]>2021-12-13 20:45:01 -0500
committerMax Isom <[email protected]>2021-12-13 20:45:34 -0500
commitc5e4c4b5cf1c08d304eb6e41aac1615e7007ee6e (patch)
treeed157c8541b92c7aedaefc73d4a62b0ea04bb322 /src/commands
parent20e944ed15d6cebc5617beaaf22032bb9c312077 (diff)
downloadmuse-c5e4c4b5cf1c08d304eb6e41aac1615e7007ee6e.tar.xz
muse-c5e4c4b5cf1c08d304eb6e41aac1615e7007ee6e.zip
Migrate clear command
Diffstat (limited to 'src/commands')
-rw-r--r--src/commands/clear.ts17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/commands/clear.ts b/src/commands/clear.ts
index 9906dab..5c1a1eb 100644
--- a/src/commands/clear.ts
+++ b/src/commands/clear.ts
@@ -1,16 +1,15 @@
import {inject, injectable} from 'inversify';
-import {Message} from 'discord.js';
+import {CommandInteraction} from 'discord.js';
+import {SlashCommandBuilder} from '@discordjs/builders';
import {TYPES} from '../types.js';
import PlayerManager from '../managers/player.js';
import Command from '.';
@injectable()
export default class implements Command {
- public name = 'clear';
- public aliases = ['c'];
- public examples = [
- ['clear', 'clears all songs in queue except currently playing'],
- ];
+ public readonly slashCommand = new SlashCommandBuilder()
+ .setName('clear')
+ .setDescription('clears all songs in queue except currently playing song');
public requiresVC = true;
@@ -20,9 +19,9 @@ export default class implements Command {
this.playerManager = playerManager;
}
- public async execute(msg: Message, _: string []): Promise<void> {
- this.playerManager.get(msg.guild!.id).clear();
+ public async executeFromInteraction(interaction: CommandInteraction) {
+ this.playerManager.get(interaction.guild!.id).clear();
- await msg.channel.send('clearer than a field after a fresh harvest');
+ await interaction.reply('clearer than a field after a fresh harvest');
}
}