Skip to content

Commit 1f0aab6

Browse files
committed
🔗 Normal Queue
1 parent 22c08a9 commit 1f0aab6

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

index.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,20 @@
11
const fetch = require("node-fetch");
22

3+
/**
4+
* Fetch Current Queue information from https://www.2b2t.io/
5+
* @async
6+
* @returns {Promise<Array>} queue - Players in Queue.
7+
*/
8+
async function queue() {
9+
let queue = await fetch("https://www.2b2t.io/api/queue?last=true");
10+
queue = await queue.json();
11+
12+
return {queue: queue[1], updatetime: queue[0]};
13+
}
14+
315
/**
416
* Fetch the Priority Queue information from https://api.2b2t.dev/prioq
17+
* @async
518
* @returns {Promise<Array>} prio[1] - Players in Prio queue. prio[2] - Estimated Time in Prio queue.
619
*/
720
async function prioQ() {
@@ -11,4 +24,4 @@ async function prioQ() {
1124
return prioQ;
1225
}
1326

14-
module.exports = { prioQ };
27+
module.exports = { prioQ, queue };

0 commit comments

Comments
 (0)