From 01584266e476260cc9ddbd2d00bc80702fa1fb09 Mon Sep 17 00:00:00 2001 From: Hirzi <64255651+HirziDevs@users.noreply.github.com> Date: Fri, 2 Jul 2021 15:33:00 +0700 Subject: [PATCH] Update index.js --- index.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/index.js b/index.js index fbae144..39b0384 100644 --- a/index.js +++ b/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)