File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 1
1
const fetch = require ( "node-fetch" ) ;
2
2
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
+
3
15
/**
4
16
* Fetch the Priority Queue information from https://api.2b2t.dev/prioq
17
+ * @async
5
18
* @returns {Promise<Array> } prio[1] - Players in Prio queue. prio[2] - Estimated Time in Prio queue.
6
19
*/
7
20
async function prioQ ( ) {
@@ -11,4 +24,4 @@ async function prioQ() {
11
24
return prioQ ;
12
25
}
13
26
14
- module . exports = { prioQ } ;
27
+ module . exports = { prioQ, queue } ;
You can’t perform that action at this time.
0 commit comments