mirror of
https://github.com/BluemediaDev/muse.git
synced 2025-06-28 09:42:41 +02:00
Add queue clear command
This commit is contained in:
parent
9e1d656e52
commit
d70bd16797
3 changed files with 45 additions and 4 deletions
22
src/commands/clear.ts
Normal file
22
src/commands/clear.ts
Normal file
|
@ -0,0 +1,22 @@
|
|||
import {Message} from 'discord.js';
|
||||
import {TYPES} from '../types';
|
||||
import {inject, injectable} from 'inversify';
|
||||
import Queue from '../services/queue';
|
||||
import Command from '.';
|
||||
|
||||
@injectable()
|
||||
export default class implements Command {
|
||||
public name = 'clear';
|
||||
public description = 'clears all songs in queue (except currently playing)';
|
||||
private readonly queue: Queue;
|
||||
|
||||
constructor(@inject(TYPES.Services.Queue) queue: Queue) {
|
||||
this.queue = queue;
|
||||
}
|
||||
|
||||
public async execute(msg: Message, _: string []): Promise<void> {
|
||||
this.queue.clear(msg.guild!.id);
|
||||
|
||||
await msg.channel.send('cleared');
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue