File tree Expand file tree Collapse file tree 2 files changed +14
-18
lines changed Expand file tree Collapse file tree 2 files changed +14
-18
lines changed Original file line number Diff line number Diff line change 1
- const fetch = require ( ' node-fetch' ) ;
1
+ const fetch = require ( " node-fetch" ) ;
2
2
3
+ /**
4
+ * Fetch the Priority Queue information from https://api.2b2t.dev/prioq
5
+ * @returns {Promise<Array> } prio[1] - Players in Prio queue. prio[2] - Estimated Time in Prio queue.
6
+ */
7
+ async function prioQ ( ) {
8
+ let prioQ = await fetch ( "https://api.2b2t.dev/prioq" ) ;
9
+ prioQ = await prioQ . json ( ) ;
3
10
4
- /*
5
-
6
- Create the prioQ function to fetch the Priority Queue information from https://api.2b2t.dev/prioq.
7
- Resolve the information as JSON format & return the function.
8
-
9
- */
10
-
11
- let prioQ = async ( message ) => {
12
-
13
- let PrioQ = await fetch ( 'https://api.2b2t.dev/prioq' ) ;
14
- PrioQ = await PrioQ . json ( ) ;
15
-
16
- return PrioQ ;
17
-
11
+ return prioQ ;
18
12
}
19
13
20
- module . exports = prioQ ;
21
-
14
+ module . exports = { prioQ } ;
Original file line number Diff line number Diff line change 14
14
" 2b2t"
15
15
],
16
16
"author" : " Vypr | vypr_ysl" ,
17
+ "contributors" : [
18
+ " Basicprogrammer10"
19
+ ],
17
20
"license" : " MIT" ,
18
21
"bugs" : {
19
22
"url" : " https://github.com/vypr-ysl/2b2t/issues"
22
25
"dependencies" : {
23
26
"node-fetch" : " ^2.6.1"
24
27
}
25
- }
28
+ }
You can’t perform that action at this time.
0 commit comments