From 69588dbb7d09cb97d699a53fca90c4364938573c Mon Sep 17 00:00:00 2001 From: Hirzi <64255651+HirziDevs@users.noreply.github.com> Date: Tue, 20 Jul 2021 19:32:32 +0700 Subject: [PATCH 01/16] Delete nodes.js --- nodes.js | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 nodes.js diff --git a/nodes.js b/nodes.js deleted file mode 100644 index c952a33..0000000 --- a/nodes.js +++ /dev/null @@ -1,23 +0,0 @@ -let nodelist = [ - { - id: 'Server ID', - name: 'Example Server 1', - nameid: 'Node1', - nodeid: '1' - }, - { - id: 'Server ID', - name: 'Example Server 2', - nameid: 'Node2', - nodeid: '2' - }, - //Add more code like bellow to the nodeslist array after comma and before ']' if you want to add more nodes - //{ - // id: 'Server ID', - // name: 'Example Server 3', - // nameid: 'Node3', - // nodeid: '1' - //}, -] - -module.exports = nodelist; From 2682ad596c3888e54e3711845438b3fa9818673b Mon Sep 17 00:00:00 2001 From: Hirzi <64255651+HirziDevs@users.noreply.github.com> Date: Tue, 20 Jul 2021 19:32:57 +0700 Subject: [PATCH 02/16] Update ready.js --- events/ready.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/events/ready.js b/events/ready.js index 3ef88a3..eb6245c 100644 --- a/events/ready.js +++ b/events/ready.js @@ -60,7 +60,7 @@ module.exports = client => { console.log(chalk.red('=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=')) console.log(chalk.green('Name: ') + chalk.cyan('PteroStats')) - console.log(chalk.green('Version: ') + chalk.cyan('Stable v1.4.0')) + console.log(chalk.green('Version: ') + chalk.cyan('Stable pre-v1.4.0')) console.log(chalk.green('Refresh Time: ') + chalk.cyan(time + ' Seconds')) console.log(chalk.green('Bot Status: ') + chalk.cyan('Online')) console.log(chalk.green('Support: ') + chalk.cyan('https://discord.gg/9Z7zpdwATZ')) From d4b38ac03904f7dd583ee6b47883dd3a73a7f74a Mon Sep 17 00:00:00 2001 From: Hirzi <64255651+HirziDevs@users.noreply.github.com> Date: Tue, 20 Jul 2021 19:34:01 +0700 Subject: [PATCH 03/16] v1.4.0 --- events/ready.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/events/ready.js b/events/ready.js index eb6245c..3ef88a3 100644 --- a/events/ready.js +++ b/events/ready.js @@ -60,7 +60,7 @@ module.exports = client => { console.log(chalk.red('=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=')) console.log(chalk.green('Name: ') + chalk.cyan('PteroStats')) - console.log(chalk.green('Version: ') + chalk.cyan('Stable pre-v1.4.0')) + console.log(chalk.green('Version: ') + chalk.cyan('Stable v1.4.0')) console.log(chalk.green('Refresh Time: ') + chalk.cyan(time + ' Seconds')) console.log(chalk.green('Bot Status: ') + chalk.cyan('Online')) console.log(chalk.green('Support: ') + chalk.cyan('https://discord.gg/9Z7zpdwATZ')) From fce0e19bd99a1eba6b7038e72df2d51081f21cdc Mon Sep 17 00:00:00 2001 From: Hirzi <64255651+HirziDevs@users.noreply.github.com> Date: Tue, 20 Jul 2021 19:35:27 +0700 Subject: [PATCH 04/16] v1.4.0 --- nodes.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 nodes.js diff --git a/nodes.js b/nodes.js new file mode 100644 index 0000000..c952a33 --- /dev/null +++ b/nodes.js @@ -0,0 +1,23 @@ +let nodelist = [ + { + id: 'Server ID', + name: 'Example Server 1', + nameid: 'Node1', + nodeid: '1' + }, + { + id: 'Server ID', + name: 'Example Server 2', + nameid: 'Node2', + nodeid: '2' + }, + //Add more code like bellow to the nodeslist array after comma and before ']' if you want to add more nodes + //{ + // id: 'Server ID', + // name: 'Example Server 3', + // nameid: 'Node3', + // nodeid: '1' + //}, +] + +module.exports = nodelist; From e58238cf8fc4db2b8e6a9b394bd0537fa9ab18af Mon Sep 17 00:00:00 2001 From: Hirzi <64255651+HirziDevs@users.noreply.github.com> Date: Mon, 26 Jul 2021 07:58:38 +0700 Subject: [PATCH 05/16] v1.5.0 --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 46124a1..f605659 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,3 @@ -# THIS BUILD HASN'T BEEN TESTED WITH NODE THAT WINGS DOWN - # PteroStats ![GitHub](https://img.shields.io/github/package-json/v/HirziDevs/PteroStats?style=flat-square) From 11a78d3ffd09d848fa079f966af696a37513f6ff Mon Sep 17 00:00:00 2001 From: Hirzi <64255651+HirziDevs@users.noreply.github.com> Date: Mon, 26 Jul 2021 07:59:33 +0700 Subject: [PATCH 06/16] v1.5.0 --- events/ready.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/events/ready.js b/events/ready.js index fed6075..60a9e0f 100644 --- a/events/ready.js +++ b/events/ready.js @@ -62,7 +62,7 @@ module.exports = client => { console.log(chalk.red('=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=')) console.log(chalk.green('Name: ') + chalk.cyan('PteroStats')) - console.log(chalk.green('Version: ') + chalk.cyan('Stable pre-v1.5.0')) + console.log(chalk.green('Version: ') + chalk.cyan('Stable v1.5.0')) console.log(chalk.green('Refresh Time: ') + chalk.cyan(time + ' Seconds')) console.log(chalk.green('Bot Status: ') + chalk.cyan('Online')) console.log(chalk.green('Support: ') + chalk.cyan('https://discord.gg/zv6maQRah3')) From b7e6f299f11c111aba7f5a342dd9e38fc87a14a5 Mon Sep 17 00:00:00 2001 From: Hirzi <64255651+HirziDevs@users.noreply.github.com> Date: Mon, 26 Jul 2021 08:12:05 +0700 Subject: [PATCH 07/16] v1.5.0 --- events/ready.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/events/ready.js b/events/ready.js index 60a9e0f..8a50d49 100644 --- a/events/ready.js +++ b/events/ready.js @@ -255,7 +255,7 @@ module.exports = client => { nodes = nodes + d }) - console.log(chalk.cyan(['[PteroStats Checker] ']) + chalk.green('Connected to ' + list.length + ' nodes') + console.log(chalk.cyan(['[PteroStats Checker] ']) + chalk.green('Connected to ' + list.length + ' nodes')) let nodeCount = '[Total ' + list.length + ']' if (debug === true) console.log(chalk.magenta('[PteroStats Debug] ') + chalk.blue(nodes)) From cdfbe9b1405d3ecb14dfe412785334c23c901278 Mon Sep 17 00:00:00 2001 From: mrxbox98 <23saahilt@students.harker.org> Date: Mon, 9 Aug 2021 21:42:43 -0700 Subject: [PATCH 08/16] Fixed chalk not being imported This would throw an error before as chalk was not imported --- index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/index.js b/index.js index 4cf5d39..9172a9c 100644 --- a/index.js +++ b/index.js @@ -2,6 +2,7 @@ const { Client, Collection } = require('discord.js') const fs = require('fs') const client = new Client() const yaml = require('js-yaml') +const chalk = require('chalk') const config = yaml.load(fs.readFileSync('./config.yml', 'utf8')) client.config = config From b99f46a11289dd096037e2bdddd2987d465d6b8c Mon Sep 17 00:00:00 2001 From: Hirzi <64255651+HirziDevs@users.noreply.github.com> Date: Sun, 15 Aug 2021 11:22:26 +0700 Subject: [PATCH 09/16] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index f605659..fa48a31 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,9 @@ PteroStats checks [pterodactyl](https://pterodactyl.io) nodes wings with [axios] if you need help contact me on discord `Hirzi#8701` or join [our discord server here](https://discord.gg/zv6maQRah3) +## Admin Apikey Permission + +enable `read` on all options, if still didn't work enable `read & write` all ### Setuping Config You need to put right config to make the bot work at [config.yml](https://github.com/HirziDevs/PteroStats/blob/main/config.yml) file From 6956b83f38034f1aaa6369f4876a0d9b9ad173ab Mon Sep 17 00:00:00 2001 From: Hirzi <64255651+HirziDevs@users.noreply.github.com> Date: Sun, 15 Aug 2021 11:27:07 +0700 Subject: [PATCH 10/16] Update README.md --- README.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index fa48a31..ddd3199 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ # PteroStats -![GitHub](https://img.shields.io/github/package-json/v/HirziDevs/PteroStats?style=flat-square) -![GitHub](https://img.shields.io/github/license/HirziDevs/PteroStats?style=flat-square) +![Version](https://img.shields.io/github/package-json/v/HirziDevs/PteroStats?style=flat-square) +![License](https://img.shields.io/github/license/HirziDevs/PteroStats?style=flat-square) -![img](https://media.discordapp.net/attachments/796259732683227157/861126504246411264/20210704_130856.jpg) +![PteroStats Banner](https://media.discordapp.net/attachments/796259732683227157/861126504246411264/20210704_130856.jpg) ## Introduction @@ -21,9 +21,9 @@ PteroStats checks [pterodactyl](https://pterodactyl.io) nodes wings with [axios] ### Screenshot - [**ItzyStore**](https://discord.gg/PS4Mf6DBzt) (No screenshot for resource becouse it will be long image) -![img](https://media.discordapp.net/attachments/796259732683227157/863359897210060820/IMG_20210710_164939.jpg) +![ItzyStore PteroStats](https://media.discordapp.net/attachments/796259732683227157/863359897210060820/IMG_20210710_164939.jpg) - [**SpaceCloud**](https://discord.gg/28z8CYmPEY) -![img](https://media.discordapp.net/attachments/586738538448420881/866624597171372032/IMG_20210719_171633.jpg) +![SpaceCloud PteroStats](https://media.discordapp.net/attachments/586738538448420881/866624597171372032/IMG_20210719_171633.jpg) ## Installation @@ -35,7 +35,9 @@ if you need help contact me on discord `Hirzi#8701` or join [our discord server ## Admin Apikey Permission -enable `read` on all options, if still didn't work enable `read & write` all +enable `read` on all options, if still didn't work enable `read & write` on all options +![Admin Apikey Permission](https://media.discordapp.net/attachments/819757140155564062/876320084992331816/Screenshot_2021-08-15-11-20-05-56.jpg) + ### Setuping Config You need to put right config to make the bot work at [config.yml](https://github.com/HirziDevs/PteroStats/blob/main/config.yml) file From 06dbea2cacd1f1547cbbc164489873cda0a8ecdd Mon Sep 17 00:00:00 2001 From: Hirzi <64255651+HirziDevs@users.noreply.github.com> Date: Thu, 26 Aug 2021 13:58:47 +0700 Subject: [PATCH 11/16] 1.5.5 --- events/ready.js | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/events/ready.js b/events/ready.js index 8a50d49..6f61a07 100644 --- a/events/ready.js +++ b/events/ready.js @@ -86,7 +86,7 @@ module.exports = client => { 'Content-Type': 'application/json', Authorization: 'Bearer ' + adminapikey } - }).then(response => { + }).then(async (response) => { let data = response.data.data data.forEach(nodes => { let id = nodes.attributes.id @@ -178,13 +178,15 @@ module.exports = client => { }) let stats = nodetable.get('node' + id) - let msgStats = '' - if (stats === null) msgStats = '**' + nodes.attributes.name + '**: ' + checking - if (stats) { + let msgStats; + if (`${stats}` === 'null') msgStats = '**' + nodes.attributes.name + '**: ' + checking + '\n' + if (`${stats}` !== 'null') { let statsname = '**' + nodes.attributes.name + '**: ' if (stats.status === true) statsname = statsname + statusonline if (stats.status === false) statsname = statsname + statusoffline + + if (resource === false) msgStats = statsname + '\n' if (stats.mode === true) statsname = statsname + ' [Maintance]' @@ -197,7 +199,6 @@ module.exports = client => { if (resource === true) msgStats = statsname + '```\n' } - if (debug === true) console.log(chalk.magenta('[PteroStats Debug] ') + chalk.blue(nodes.attributes.name + ': ' + stats.status)) list.push(msgStats) }) @@ -236,8 +237,8 @@ module.exports = client => { let userCount = paneltable.get('userCount') let serverCount = paneltable.get('serverCount') - if (userCount === null) userCount = checking - if (serverCount === null) serverCount = checking + if (userCount === null) userCount = 'checking' + if (serverCount === null) serverCount = 'checking' if (userCount !== 'N/A') paneltable.set('panel', '**Panel**: ' + statusonline) if (userCount === 'N/A') { @@ -282,7 +283,11 @@ module.exports = client => { embed.setDescription('\n**Nodes Stats' + nodeCount + '**\n' + nodes) } - ch.send(embed).then(msg => { msg.delete({ timeout: time + '000' }) }) + let messages = await ch.messages.fetch({limit: 10}) + messages = messages.filter(m => m.author.id === client.user.id).last(); + if (messages == null) ch.send(embed) + else messages.edit(embed) + console.log(chalk.cyan('[PteroStats Checker] ') + chalk.green('Posted Stats')) if (panel !== null) console.log(chalk.cyan('[PteroStats Checker] ') + chalk.green('Stats Updated')) From 3bca9c465898d0d42ae840b6805de24be6c48da2 Mon Sep 17 00:00:00 2001 From: Hirzi <64255651+HirziDevs@users.noreply.github.com> Date: Thu, 26 Aug 2021 13:59:50 +0700 Subject: [PATCH 12/16] remove dev build message --- events/ready.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/events/ready.js b/events/ready.js index 6f61a07..c7e28f9 100644 --- a/events/ready.js +++ b/events/ready.js @@ -67,8 +67,7 @@ module.exports = client => { console.log(chalk.green('Bot Status: ') + chalk.cyan('Online')) console.log(chalk.green('Support: ') + chalk.cyan('https://discord.gg/zv6maQRah3')) console.log(chalk.red('=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=')) - console.log(chalk.red('You are using dev build, something not wanted might be happen!')) - + if(paneltable.get('URL') === null) console.log(chalk.cyan('It seems you are using our bot for first time, thank you for choosing our bot, if you need help you can join our support server!')) if(paneltable.get('URL') !== api) console.log(chalk.cyan('Panel url changed, please allow the bot to check the nodes status for ' + time + ' seconds')) paneltable.set('URL',api) From b6bad7075757fcbbd25538d536b6f69d8173f010 Mon Sep 17 00:00:00 2001 From: Hirzi <64255651+HirziDevs@users.noreply.github.com> Date: Thu, 26 Aug 2021 14:00:52 +0700 Subject: [PATCH 13/16] Update package.json --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 498bad0..d5c17cc 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,12 @@ { "name": "pterostats", - "version": "v1.5.0", + "version": "v1.5.5", "description": "PteroStats is a bot designed to check Panel, Nodes, and Databases status and post it to your discord server", "license": "Apache-2.0", "repository": "HirziDevs/PteroStats", "homepage": "https://pterostats.hirzidevs.net", "bugs": { - "email": "hirzigamingyt@gmail.com", + "email": "hirzidevs@gmail.com", "url": "https://github.com/HirziDevs/PteroStats" }, "scripts": { @@ -16,7 +16,7 @@ "axios": "^0.21.1", "chalk": "^4.1.1", "js-yaml": "^4.1.0", - "discord.js": "^12.5.3", + "discord.js": "12.5.3", "quick.db": "^7.1.3" }, "engines": { From 25d2b2e785e5a52f2252083c5bb63cecdf735578 Mon Sep 17 00:00:00 2001 From: Hirzi <64255651+HirziDevs@users.noreply.github.com> Date: Thu, 26 Aug 2021 14:06:16 +0700 Subject: [PATCH 14/16] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ddd3199..aa7abb8 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,9 @@ PteroStats checks [pterodactyl](https://pterodactyl.io) nodes wings with [axios] ### Screenshot -- [**ItzyStore**](https://discord.gg/PS4Mf6DBzt) (No screenshot for resource becouse it will be long image) +- [**TreeCloud**](https://discord.gg/TCBhPan6SY) +![TreeCloud PteroStats](https://media.discordapp.net/attachments/819757140155564062/880346867949518848/Screenshot_2021-08-26-14-03-15-50_572064f74bd5f9fa804b05334aa4f912.jpg) +- [**ItzyStore**](https://discord.gg/PS4Mf6DBzt) ![ItzyStore PteroStats](https://media.discordapp.net/attachments/796259732683227157/863359897210060820/IMG_20210710_164939.jpg) - [**SpaceCloud**](https://discord.gg/28z8CYmPEY) ![SpaceCloud PteroStats](https://media.discordapp.net/attachments/586738538448420881/866624597171372032/IMG_20210719_171633.jpg) From 230f856adb4ca3899f1c2304f484684b472d8d16 Mon Sep 17 00:00:00 2001 From: Hirzi <64255651+HirziDevs@users.noreply.github.com> Date: Thu, 26 Aug 2021 14:09:42 +0700 Subject: [PATCH 15/16] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index aa7abb8..847d111 100644 --- a/README.md +++ b/README.md @@ -118,3 +118,7 @@ A: You can join our [discord server](https://discord.gg/zv6maQRah3) * __[PteroBot Discord](https://discord.gg/zv6maQRah3)__ * __[Pterodactyl Panel](https://pterodactyl.io)__ * __[Pterodactyl API](https://dashflo.net/docs/api/pterodactyl/v1)__ + +### Special Thanks to + +- ItsJustNickDev(from Discord) From bcfa266be64dda11955f0bf9732da086bcea522c Mon Sep 17 00:00:00 2001 From: Hirzi <64255651+HirziDevs@users.noreply.github.com> Date: Sat, 28 Aug 2021 20:23:05 +0700 Subject: [PATCH 16/16] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 847d111..40e817b 100644 --- a/README.md +++ b/README.md @@ -105,7 +105,7 @@ A: No, the pterodactyl v0.7 is not supported Q: How much nodes can i add? -A: You can add as much your panel have +A: The bot will automatically add nodes from your panel -