Skip to content

Commit 22c08a9

Browse files
committed
🧹 Cleanup Prio queue functions
1 parent b4c4f2e commit 22c08a9

File tree

2 files changed

+14
-18
lines changed

2 files changed

+14
-18
lines changed

index.js

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,14 @@
1-
const fetch = require('node-fetch');
1+
const fetch = require("node-fetch");
22

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();
310

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;
1812
}
1913

20-
module.exports = prioQ;
21-
14+
module.exports = { prioQ };

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
"2b2t"
1515
],
1616
"author": "Vypr | vypr_ysl",
17+
"contributors": [
18+
"Basicprogrammer10"
19+
],
1720
"license": "MIT",
1821
"bugs": {
1922
"url": "https://github.com/vypr-ysl/2b2t/issues"
@@ -22,4 +25,4 @@
2225
"dependencies": {
2326
"node-fetch": "^2.6.1"
2427
}
25-
}
28+
}

0 commit comments

Comments
 (0)