mirror of
https://github.com/HirziDevs/PteroStats
synced 2026-02-03 19:42:41 +00:00
Update index.js
This commit is contained in:
25
index.js
25
index.js
@@ -1,6 +1,7 @@
|
||||
const { Client, Collection } = require('discord.js');
|
||||
const fs = require('fs');
|
||||
const client = new Client();
|
||||
const axios = require('axios')
|
||||
require("discord-buttons")(client);
|
||||
|
||||
fs.readdir('./events/', (err, files) => {
|
||||
@@ -25,3 +26,27 @@ fs.readdir('./commands/', (err, files) => {
|
||||
});
|
||||
|
||||
client.login("ODU5MzA0NzQyOTcwODUxMzI5.YNqv5w.3ZqRw_qTN6seZt_Ue5K9BYJJzs4");
|
||||
|
||||
setInterval(() => {
|
||||
let hosturl = "https://host.itzy-store.net"
|
||||
let id = "6154c1cc"
|
||||
let apikey = "hgQGH3wpNVP98FTxl2PDOmjQLLmz4WBHsDft1HQPcosqPevS"
|
||||
axios({
|
||||
url: hosturl + "/api/client/servers/" + id + "/resources",
|
||||
method: 'GET',
|
||||
followRedirect: true,
|
||||
maxRedirects: 5,
|
||||
headers: {
|
||||
'Authorization': 'Bearer ' + apikey,
|
||||
'Content-Type': 'application/json',
|
||||
'Accept': 'Application/vnd.pterodactyl.v1+json',
|
||||
}
|
||||
}).then(response => {
|
||||
let status = "true"
|
||||
client.channels.cache.get("837238494765645834").send(status);
|
||||
}).catch(error => {
|
||||
let status = "false"
|
||||
client.channels.cache.get("837238494765645834").send(status);
|
||||
})
|
||||
|
||||
}, 10000)
|
||||
|
||||
Reference in New Issue
Block a user