mirror of
https://github.com/BluemediaDev/muse.git
synced 2025-08-03 22:53:30 +02:00
Add pause/resume
This commit is contained in:
parent
e55acbb718
commit
2875c6ceb8
4 changed files with 123 additions and 26 deletions
src/commands
|
@ -36,6 +36,29 @@ export default class implements Command {
|
|||
}
|
||||
|
||||
public async execute(msg: Message, args: string []): Promise<void> {
|
||||
const queue = this.queueManager.get(msg.guild!.id);
|
||||
|
||||
if (args.length === 0) {
|
||||
if (this.playerManager.get(msg.guild!.id).status === STATUS.PLAYING) {
|
||||
await msg.channel.send('error: already playing, give me a song name');
|
||||
return;
|
||||
}
|
||||
|
||||
// Must be resuming play
|
||||
if (queue.get().length === 0) {
|
||||
await msg.channel.send('error: nothing to play');
|
||||
return;
|
||||
}
|
||||
|
||||
const channel = getMostPopularVoiceChannel(msg.guild!);
|
||||
|
||||
await this.playerManager.get(msg.guild!.id).connect(channel);
|
||||
await this.playerManager.get(msg.guild!.id).play();
|
||||
|
||||
await msg.channel.send('play resuming');
|
||||
return;
|
||||
}
|
||||
|
||||
const newSongs: QueuedSong[] = [];
|
||||
|
||||
const res = new LoadingMessage(msg.channel as TextChannel, 'hold on a sec');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue