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>
|
||||
<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>
|
||||
|
|
|
@ -187,16 +187,12 @@ class Player {
|
|||
/**
|
||||
* Gets the guild queue.
|
||||
* @param {string} guildID
|
||||
* @returns {Promise<Queue>}
|
||||
* @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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue