From e2134852936a7084afb3ec987b4d50f25392898e Mon Sep 17 00:00:00 2001 From: Androz2091 Date: Sat, 18 Jan 2020 18:29:53 +0100 Subject: [PATCH] feat: getQueue is now synchronous --- docs/Player.html | 4 ++-- src/Player.js | 12 ++++-------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/docs/Player.html b/docs/Player.html index 84e95b1..50f5563 100644 --- a/docs/Player.html +++ b/docs/Player.html @@ -929,7 +929,7 @@ -

getQueue(guildID) → {Promise.<Queue>}

+

getQueue(guildID) → (nullable) {Queue}

@@ -1061,7 +1061,7 @@
-Promise.<Queue> +Queue
diff --git a/src/Player.js b/src/Player.js index 76dec81..6670a50 100644 --- a/src/Player.js +++ b/src/Player.js @@ -187,16 +187,12 @@ class Player { /** * Gets the guild queue. * @param {string} guildID - * @returns {Promise} + * @returns {?Queue} */ getQueue(guildID) { - return new Promise(async(resolve, reject) => { - // Gets guild queue - let queue = this.queues.find((g) => g.guildID === guildID); - if(!queue) reject('Not playing'); - // Resolves the guild queue - resolve(queue); - }); + // Gets guild queue + let queue = this.queues.find((g) => g.guildID === guildID); + return queue; } /**