Refreactor to add a command handler
This commit is contained in:
19
commands/stats.js
Normal file
19
commands/stats.js
Normal file
@ -0,0 +1,19 @@
|
||||
// stats.js
|
||||
const unirest = require("unirest");
|
||||
|
||||
async function getStats(key) {
|
||||
let requestData = await unirest
|
||||
.get('https://api.discord-linux.com/stats')
|
||||
.headers({
|
||||
'Accept': 'application/json', 'Content-Type': 'application/json',
|
||||
'x-discord-linux-auth': key
|
||||
})
|
||||
return requestData.body
|
||||
}
|
||||
|
||||
async function stats(key) {
|
||||
const response = await getStats(key)
|
||||
console.log(response)
|
||||
}
|
||||
|
||||
module.exports = { stats, getStats }
|
Reference in New Issue
Block a user