mirror of
https://github.com/BluemediaGER/muse.git
synced 2024-11-23 09:15:29 +01:00
Migrate clear command
This commit is contained in:
parent
20e944ed15
commit
c5e4c4b5cf
|
@ -1,16 +1,15 @@
|
||||||
import {inject, injectable} from 'inversify';
|
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 {TYPES} from '../types.js';
|
||||||
import PlayerManager from '../managers/player.js';
|
import PlayerManager from '../managers/player.js';
|
||||||
import Command from '.';
|
import Command from '.';
|
||||||
|
|
||||||
@injectable()
|
@injectable()
|
||||||
export default class implements Command {
|
export default class implements Command {
|
||||||
public name = 'clear';
|
public readonly slashCommand = new SlashCommandBuilder()
|
||||||
public aliases = ['c'];
|
.setName('clear')
|
||||||
public examples = [
|
.setDescription('clears all songs in queue except currently playing song');
|
||||||
['clear', 'clears all songs in queue except currently playing'],
|
|
||||||
];
|
|
||||||
|
|
||||||
public requiresVC = true;
|
public requiresVC = true;
|
||||||
|
|
||||||
|
@ -20,9 +19,9 @@ export default class implements Command {
|
||||||
this.playerManager = playerManager;
|
this.playerManager = playerManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async execute(msg: Message, _: string []): Promise<void> {
|
public async executeFromInteraction(interaction: CommandInteraction) {
|
||||||
this.playerManager.get(msg.guild!.id).clear();
|
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');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue