Refreactor to add a command handler

This commit is contained in:
raven
2023-01-11 15:48:57 -05:00
parent da9f17117a
commit aceead9064
12 changed files with 343 additions and 292 deletions

19
commands/stats.js Normal file
View 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 }