feat: getQueue is now synchronous
This commit is contained in:
parent
227128049b
commit
e213485293
2 changed files with 6 additions and 10 deletions
|
@ -929,7 +929,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h4 class="name" id="getQueue"><span class="type-signature"></span>getQueue<span class="signature">(guildID)</span><span class="type-signature"> → {Promise.<<a href="Queue.html">Queue</a>>}</span></h4>
|
<h4 class="name" id="getQueue"><span class="type-signature"></span>getQueue<span class="signature">(guildID)</span><span class="type-signature"> → (nullable) {<a href="Queue.html">Queue</a>}</span></h4>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1061,7 +1061,7 @@
|
||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
|
|
||||||
<span class="param-type"><code>Promise.<<a href="Queue.html">Queue</a>></code></span>
|
<span class="param-type"><code><a href="Queue.html">Queue</a></code></span>
|
||||||
|
|
||||||
|
|
||||||
</dd>
|
</dd>
|
||||||
|
|
|
@ -187,16 +187,12 @@ class Player {
|
||||||
/**
|
/**
|
||||||
* Gets the guild queue.
|
* Gets the guild queue.
|
||||||
* @param {string} guildID
|
* @param {string} guildID
|
||||||
* @returns {Promise<Queue>}
|
* @returns {?Queue}
|
||||||
*/
|
*/
|
||||||
getQueue(guildID) {
|
getQueue(guildID) {
|
||||||
return new Promise(async(resolve, reject) => {
|
// Gets guild queue
|
||||||
// Gets guild queue
|
let queue = this.queues.find((g) => g.guildID === guildID);
|
||||||
let queue = this.queues.find((g) => g.guildID === guildID);
|
return queue;
|
||||||
if(!queue) reject('Not playing');
|
|
||||||
// Resolves the guild queue
|
|
||||||
resolve(queue);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue