update queue

This commit is contained in:
Snowflake107 2021-06-19 19:57:13 +05:45
parent e50066ee0d
commit 8902d06057

View file

@ -150,7 +150,7 @@ class Queue<T = unknown> {
*/ */
setPaused(paused?: boolean) { setPaused(paused?: boolean) {
if (!this.connection) return false; if (!this.connection) return false;
return paused ? this.connection.pause() : this.connection.resume(); return paused ? this.connection.pause(true) : this.connection.resume();
} }
/** /**
@ -180,8 +180,7 @@ class Queue<T = unknown> {
*/ */
setRepeatMode(mode: QueueRepeatMode) { setRepeatMode(mode: QueueRepeatMode) {
if (![QueueRepeatMode.OFF, QueueRepeatMode.QUEUE, QueueRepeatMode.TRACK].includes(mode)) throw new Error(`Unknown repeat mode "${mode}"!`); if (![QueueRepeatMode.OFF, QueueRepeatMode.QUEUE, QueueRepeatMode.TRACK].includes(mode)) throw new Error(`Unknown repeat mode "${mode}"!`);
const prev = this.repeatMode; if (mode === this.repeatMode) return false;
if (mode === prev) return false;
this.repeatMode = mode; this.repeatMode = mode;
return true; return true;
} }