mirror of
https://github.com/BluemediaDev/muse.git
synced 2025-06-28 01:32:42 +02:00
Add /loop-queue command (#989)
This commit is contained in:
parent
45bdbd1494
commit
769f9da8a2
6 changed files with 64 additions and 1 deletions
|
@ -63,6 +63,7 @@ export default class {
|
|||
public status = STATUS.PAUSED;
|
||||
public guildId: string;
|
||||
public loopCurrentSong = false;
|
||||
public loopCurrentQueue = false;
|
||||
|
||||
private queue: QueuedSong[] = [];
|
||||
private queuePosition = 0;
|
||||
|
@ -545,6 +546,17 @@ export default class {
|
|||
return;
|
||||
}
|
||||
|
||||
// Automatically re-add current song to queue
|
||||
if (this.loopCurrentQueue && newState.status === AudioPlayerStatus.Idle && this.status === STATUS.PLAYING) {
|
||||
const currentSong = this.getCurrent();
|
||||
|
||||
if (currentSong) {
|
||||
this.add(currentSong);
|
||||
} else {
|
||||
throw new Error('No song currently playing.');
|
||||
}
|
||||
}
|
||||
|
||||
if (newState.status === AudioPlayerStatus.Idle && this.status === STATUS.PLAYING) {
|
||||
await this.forward(1);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue