From 8a83ec40df799b145cb75179042e3ff5be297fb6 Mon Sep 17 00:00:00 2001 From: Anthony M <47640864+IDeletedSystem64@users.noreply.github.com> Date: Tue, 19 Jan 2021 15:22:19 -0600 Subject: [PATCH 01/33] Create README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..91a50d8 --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# anitrox +Source for ProjectAnitrox, This is mostly for webhooks and file backups. From 755dffbc4f3b9dbac0fcd51f0f77a65b8d113fa3 Mon Sep 17 00:00:00 2001 From: Anthony M <47640864+IDeletedSystem64@users.noreply.github.com> Date: Tue, 19 Jan 2021 18:02:35 -0600 Subject: [PATCH 02/33] Remove token from config.json --- config.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.json b/config.json index 054d70b..885f58c 100644 --- a/config.json +++ b/config.json @@ -1,5 +1,5 @@ { "prefix": "n!", - "token": "NTQwOTQxNjc5MDQ2Mjk1NTUz.XotbnA.0hllsNlr9hWaepl3KwB1Bhh5TnA", + "token": "", "ownerID": "309427567004483586" -} \ No newline at end of file +} From 0c1ced985943bc9ff66e39fb87371eb7f60e5c0b Mon Sep 17 00:00:00 2001 From: Anthony M <47640864+IDeletedSystem64@users.noreply.github.com> Date: Sun, 31 Jan 2021 22:06:11 -0600 Subject: [PATCH 03/33] Delete servers.js --- commands/servers.js | 37 ------------------------------------- 1 file changed, 37 deletions(-) delete mode 100644 commands/servers.js diff --git a/commands/servers.js b/commands/servers.js deleted file mode 100644 index a8875a4..0000000 --- a/commands/servers.js +++ /dev/null @@ -1,37 +0,0 @@ - -module.exports = { - name: 'servers', - description: 'Lists what servers the bot is in', - execute(message) { - if (message.author.id == 309427567004483586) { - var i = 0, guildLength = 0, ownerData = {}; -var fileToExportTo = "./servers.txt"; - -client.guilds.forEach(g=> { - guildLength = client.guilds.size; - var moreSquares = ""; - for (var cnt = 0; cnt < g.name.length; cnt++) moreSquares = moreSquares + "="; - - var content = "\n== " + g.name + " ==\nID: " + g.id + "\nOWNER: " + g.owner.user.tag + " (" + g.owner.id + ")\n===" + moreSquares + "===\n"; - require("fs").appendFile(fileToExportTo, content, 'utf8', (err) => { if (err) { console.error(err); } }); - - if (ownerData[g.owner.id] == null) - ownerData[g.owner.id] = { "id": g.owner.id, "tag": g.owner.user.tag, "count": 1 }; - else - ownerData[g.owner.id].count = (ownerData[g.owner.id].count + 1); - i++; -}); - -var morecontent = []; -for (let owner in ownerData) { - morecontent.push(ownerData[owner]["tag"] + " (" + ownerData[owner]["id"] + "): " + ownerData[owner]["count"]); -}; - -var content = "\n\n== FINAL COUNTS [as they appear they owned] ==\n" + morecontent.join("\n") + "\n==============================================\nExported: " + new Date().toString() + "\nData is as accurate as exported time & date."; -require("fs").appendFile(fileToExportTo, content, 'utf8', (err) => { if (err) { console.error(err); } }); -if (i == guildLength) - message.channel.send(client.config.system.emotes.success + " Done."); - } else { - message.channel.send("<:NyabotDenied:697145462565896194> Access Denied, You must be bot owner to execute this command."); - } - }} \ No newline at end of file From 5888467bf540f19e433084c145716713bff5dd5b Mon Sep 17 00:00:00 2001 From: Anthony M <47640864+IDeletedSystem64@users.noreply.github.com> Date: Fri, 5 Feb 2021 22:17:07 -0600 Subject: [PATCH 04/33] userinfo --- commands/userinfo.js | 157 +++++++++++++++++++++++++++++-------------- 1 file changed, 107 insertions(+), 50 deletions(-) diff --git a/commands/userinfo.js b/commands/userinfo.js index 42ddd99..dd6c121 100644 --- a/commands/userinfo.js +++ b/commands/userinfo.js @@ -1,52 +1,109 @@ -const { User } = require("discord.js"); - module.exports = { - - name: 'userinfo', - description: 'Shows information about you or another user.', - execute(client, message, args) { - const taggedUser = message.mentions.users.first(); - + name: "userinfo", + description: "Get the information of a user.", + guildOnly: false, + authorizedGuilds: [], + hidden: false, + permissions: ["DEFAULT"], + cooldown: 2, + aliases: [ "user", "u" ], + syntax: [ + " " + ], + execute: async(client, message, args) => { + function fetchData(type, user, wasInCache) { - //Actual code - const embed = { - "title": "<:userinfo:793885335498522685> **User Information**", - "description": "Everything you've ever wanted to know about **" + taggedUser.username + ("!**"), - "color": 11038194, - - "footer": { - "icon_url": "https://cdn.discordapp.com/attachments/549707869138714635/793524910172667964/Screenshot_26.png", - "text": "Anitrox © IDeletedSystem64 2018-2021. All Rights Reserved" - }, - "thumbnail": { - "url": taggedUser.displayAvatarURL({ dynamic: true }) - }, - "fields": [ - { - "name": "<:userquestion:793984046912110633> **Full Username**", - "value": taggedUser.username + ("#") + taggedUser.discriminator - }, - { - "name": "<:userquestion:793984046912110633> User Status", - "value": taggedUser.status, - "value": taggedUser.presence - }, - { - "name": "<:userquestion:793984046912110633> User ID", - "value": taggedUser.id - }, - { - "name": "<:userquestion:793984046912110633> User Joined Discord", - "value": taggedUser.CreatedAt, - "inline": true - }, - { - "name": "<:userquestion:793984046912110633> User Joined Server", - "value": "tba", - "inline": true - } - ] - }; - message.channel.send({ embed }); - } - }; \ No newline at end of file + var embedFields = [ + { name: "Username", value: user.username, inline: true }, + { name: "Discriminator", value: user.discriminator, inline: true }, + { name: "Full Tag", value: (user.bot) ? user.tag + " **[BOT]**" : user.tag, inline: false }, + { name: "ID", value: user.id, inline: true }, + { name: "Joined Discord", value: user.createdAt, inline: true }, + { name: "Avatar", value: "Click/Tap **[HERE]("+user.displayAvatarURL({ format: 'png', dynamic: true, size: 1024 })+")** for full size!", inline: false } + ]; + + var status = "Offline"; + var states = { + "offline": client.config.system.emotes.discord.offline + " **Offline**", + "idle": client.config.system.emotes.discord.idle + " **Idle**", + "dnd": client.config.system.emotes.discord.dnd + " **Do Not Disturb**", + "online": client.config.system.emotes.discord.online + " **Online**" + }; + + if (user.presence != "offline") { + status = states[user.presence.status]; + if (user.presence.activities.length > 0) { + for (var i=0;i 1) + embedFields.push({ name: "Roles", value: message.guild.members.cache.get(user.id).roles.cache.array().sort((a, b) => a.comparePositionTo(b)).reverse().map(role => role).join(" ").replace("@"+"everyone", "") }); // Thanks to Nooooah#9507 + else + embedFields.push({ name: "Roles", value: "User has no roles.. :<" }); + + function getJoinPosition(ID) { + var memberJoins = message.guild.members.cache.array().sort((a, b) => a.joinedAt - b.joinedAt); + for (var i = 0; i < memberJoins.length; i++){ if (memberJoins[i].id == ID) return i; } ; + }; + + embedFields.push( + { name: "Joined Server", value: new Date(message.guild.members.cache.get(user.id).joinedAt).toString(), inline: true }, + { name: "Join Position", value: (getJoinPosition(user.id) + 1), inline: true } + ); + } else { }; + }; + + var embed = { embed: { + thumbnail: { url: user.displayAvatarURL({ format: 'png', dynamic: true, size: 1024 }) }, + title: client.config.system.emotes.information + " **User Information**", + color: client.config.system.embedColors.lime, + fields: embedFields, + footer: { text: client.config.system.footerText } + }}; + + return embed; + }; + + var userToGet = message.author.id, gotData = null; + try { + if (args[0] != null) { + userToGet = args[0].replace(/[<@!>]/g, ''); + }; + var wasInCache = client.users.cache.get(userToGet) || false; + + await client.users.fetch(userToGet).then(function(user) { + gotData = fetchData("user", user, wasInCache); + }); + + message.channel.send(gotData); + } catch (Ex) { + var embed = { embed: { + title: client.config.system.emotes.error + " **User Information**", + color: client.config.system.embedColors.red, + footer: { text: client.config.system.footerText } + }}; + + if (Ex.message.includes("Unknown User")) + embed.embed.description = "**That user does not exist!**\nCheck the ID and/or ping and try again."; + else + embed.embed.fields = [ { name: "Error! Error!", value: "```js\n" + Ex.stack + "```" } ]; + message.channel.send(embed); + }; + } +}; \ No newline at end of file From ed6302855a9db772a8ac267fe19928906b24a781 Mon Sep 17 00:00:00 2001 From: Anthony M <47640864+IDeletedSystem64@users.noreply.github.com> Date: Sat, 6 Feb 2021 10:03:32 -0600 Subject: [PATCH 05/33] Delete userinfo.js --- commands/userinfo.js | 109 ------------------------------------------- 1 file changed, 109 deletions(-) delete mode 100644 commands/userinfo.js diff --git a/commands/userinfo.js b/commands/userinfo.js deleted file mode 100644 index dd6c121..0000000 --- a/commands/userinfo.js +++ /dev/null @@ -1,109 +0,0 @@ -module.exports = { - name: "userinfo", - description: "Get the information of a user.", - guildOnly: false, - authorizedGuilds: [], - hidden: false, - permissions: ["DEFAULT"], - cooldown: 2, - aliases: [ "user", "u" ], - syntax: [ - " " - ], - execute: async(client, message, args) => { - function fetchData(type, user, wasInCache) { - - var embedFields = [ - { name: "Username", value: user.username, inline: true }, - { name: "Discriminator", value: user.discriminator, inline: true }, - { name: "Full Tag", value: (user.bot) ? user.tag + " **[BOT]**" : user.tag, inline: false }, - { name: "ID", value: user.id, inline: true }, - { name: "Joined Discord", value: user.createdAt, inline: true }, - { name: "Avatar", value: "Click/Tap **[HERE]("+user.displayAvatarURL({ format: 'png', dynamic: true, size: 1024 })+")** for full size!", inline: false } - ]; - - var status = "Offline"; - var states = { - "offline": client.config.system.emotes.discord.offline + " **Offline**", - "idle": client.config.system.emotes.discord.idle + " **Idle**", - "dnd": client.config.system.emotes.discord.dnd + " **Do Not Disturb**", - "online": client.config.system.emotes.discord.online + " **Online**" - }; - - if (user.presence != "offline") { - status = states[user.presence.status]; - if (user.presence.activities.length > 0) { - for (var i=0;i 1) - embedFields.push({ name: "Roles", value: message.guild.members.cache.get(user.id).roles.cache.array().sort((a, b) => a.comparePositionTo(b)).reverse().map(role => role).join(" ").replace("@"+"everyone", "") }); // Thanks to Nooooah#9507 - else - embedFields.push({ name: "Roles", value: "User has no roles.. :<" }); - - function getJoinPosition(ID) { - var memberJoins = message.guild.members.cache.array().sort((a, b) => a.joinedAt - b.joinedAt); - for (var i = 0; i < memberJoins.length; i++){ if (memberJoins[i].id == ID) return i; } ; - }; - - embedFields.push( - { name: "Joined Server", value: new Date(message.guild.members.cache.get(user.id).joinedAt).toString(), inline: true }, - { name: "Join Position", value: (getJoinPosition(user.id) + 1), inline: true } - ); - } else { }; - }; - - var embed = { embed: { - thumbnail: { url: user.displayAvatarURL({ format: 'png', dynamic: true, size: 1024 }) }, - title: client.config.system.emotes.information + " **User Information**", - color: client.config.system.embedColors.lime, - fields: embedFields, - footer: { text: client.config.system.footerText } - }}; - - return embed; - }; - - var userToGet = message.author.id, gotData = null; - try { - if (args[0] != null) { - userToGet = args[0].replace(/[<@!>]/g, ''); - }; - var wasInCache = client.users.cache.get(userToGet) || false; - - await client.users.fetch(userToGet).then(function(user) { - gotData = fetchData("user", user, wasInCache); - }); - - message.channel.send(gotData); - } catch (Ex) { - var embed = { embed: { - title: client.config.system.emotes.error + " **User Information**", - color: client.config.system.embedColors.red, - footer: { text: client.config.system.footerText } - }}; - - if (Ex.message.includes("Unknown User")) - embed.embed.description = "**That user does not exist!**\nCheck the ID and/or ping and try again."; - else - embed.embed.fields = [ { name: "Error! Error!", value: "```js\n" + Ex.stack + "```" } ]; - message.channel.send(embed); - }; - } -}; \ No newline at end of file From 8d062d8a935e99d1b50d184355233b069813fddd Mon Sep 17 00:00:00 2001 From: Anthony M <47640864+IDeletedSystem64@users.noreply.github.com> Date: Sat, 6 Feb 2021 11:18:51 -0600 Subject: [PATCH 06/33] Fix userinfo from hanging the bot --- commands/userinfo.js | 64 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 commands/userinfo.js diff --git a/commands/userinfo.js b/commands/userinfo.js new file mode 100644 index 0000000..cf537b7 --- /dev/null +++ b/commands/userinfo.js @@ -0,0 +1,64 @@ +module.exports = { + + name: "userinfo", + description: "Gets info about an user, such as ID, Discord Join date and more.", + execute(client, message, args) { + + + + + + + const user = message.mentions.users.first(); + const activity = user.presence.activities[i]; + + for (var i=0;i Date: Thu, 11 Feb 2021 16:07:16 -0600 Subject: [PATCH 07/33] Update config.json --- config.json | 1 - 1 file changed, 1 deletion(-) diff --git a/config.json b/config.json index 885f58c..67aeef8 100644 --- a/config.json +++ b/config.json @@ -1,5 +1,4 @@ { "prefix": "n!", - "token": "", "ownerID": "309427567004483586" } From 06e9797a5f79c5b51ec4bc936418bbd5e35fcd43 Mon Sep 17 00:00:00 2001 From: Anthony M <47640864+IDeletedSystem64@users.noreply.github.com> Date: Thu, 11 Feb 2021 21:43:47 -0600 Subject: [PATCH 08/33] begin moving embeds to a json file --- embeds.json | 1 + 1 file changed, 1 insertion(+) create mode 100644 embeds.json diff --git a/embeds.json b/embeds.json new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/embeds.json @@ -0,0 +1 @@ + From 50984b9ddc854eca4178075c93d03c5e4bc9bda7 Mon Sep 17 00:00:00 2001 From: Sophie M <47640864+IDeletedSystem64@users.noreply.github.com> Date: Mon, 3 May 2021 14:01:23 -0500 Subject: [PATCH 09/33] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 91a50d8..e232896 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,2 @@ -# anitrox -Source for ProjectAnitrox, This is mostly for webhooks and file backups. +# Anitrox Stable +There isn't really much support for self-hosting, though I will you set it up at least, If you have are having issues with the officially hosted bot (such as command errors) join the Anitrox Central Discord server for support or if its a issue with the bot itself open a GitHub Issue From cab232f1013fc4d62853430b1f45bae4ae6bc8b8 Mon Sep 17 00:00:00 2001 From: Sophie Mondz Date: Mon, 21 Mar 2022 13:08:20 -0500 Subject: [PATCH 10/33] Delete config.json --- config.json | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 config.json diff --git a/config.json b/config.json deleted file mode 100644 index 67aeef8..0000000 --- a/config.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "prefix": "n!", - "ownerID": "309427567004483586" -} From 422338c85193f75663e260eaa5d9c9913047d863 Mon Sep 17 00:00:00 2001 From: Sophie Mondz Date: Mon, 21 Mar 2022 13:08:29 -0500 Subject: [PATCH 11/33] Delete README.md --- README.md | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 README.md diff --git a/README.md b/README.md deleted file mode 100644 index e232896..0000000 --- a/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# Anitrox Stable -There isn't really much support for self-hosting, though I will you set it up at least, If you have are having issues with the officially hosted bot (such as command errors) join the Anitrox Central Discord server for support or if its a issue with the bot itself open a GitHub Issue From ae64d600af4e75cf86fad8d6431636d0c9b481a5 Mon Sep 17 00:00:00 2001 From: Sophie Mondz Date: Mon, 21 Mar 2022 13:08:51 -0500 Subject: [PATCH 12/33] Delete userinfo.js --- commands/userinfo.js | 64 -------------------------------------------- 1 file changed, 64 deletions(-) delete mode 100644 commands/userinfo.js diff --git a/commands/userinfo.js b/commands/userinfo.js deleted file mode 100644 index cf537b7..0000000 --- a/commands/userinfo.js +++ /dev/null @@ -1,64 +0,0 @@ -module.exports = { - - name: "userinfo", - description: "Gets info about an user, such as ID, Discord Join date and more.", - execute(client, message, args) { - - - - - - - const user = message.mentions.users.first(); - const activity = user.presence.activities[i]; - - for (var i=0;i Date: Mon, 21 Mar 2022 13:45:53 -0500 Subject: [PATCH 13/33] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a69a449..0bcc1cc 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# Anitrox Dev Branch (anitrox_unstable) -This is the development branch for Anitrox, If you want those fresh hot Anitrox builds right from the oven, you've come to the right place! +# Anitrox Stable Branch (anitrox_stable) +This is the stable branch, If you want the prepackaged and prepared builds, you're at the right place. # Dependencies to get started To begin, you will need to satisfy the following dependencies: Node.JS: 14 From b866641fac662e115086735868af54b7b0f8e21b Mon Sep 17 00:00:00 2001 From: IDeletedSystem64 Date: Sat, 2 Jul 2022 21:07:43 -0500 Subject: [PATCH 14/33] Add functions, getTime function. This is for logging --- functions/getTime.js | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 functions/getTime.js diff --git a/functions/getTime.js b/functions/getTime.js new file mode 100644 index 0000000..8e7a596 --- /dev/null +++ b/functions/getTime.js @@ -0,0 +1,7 @@ +module.exports = () => { + const date = new Date(); + const timeDate = date.toLocaleDateString(); + const time = date.toLocaleTimeString(); + + return ` ${time} | ${timeDate} `; +}; From b7f03b872cb4ab857f16c4897f90d81efd2711e0 Mon Sep 17 00:00:00 2001 From: IDeletedSystem64 Date: Sun, 3 Jul 2022 17:12:40 -0500 Subject: [PATCH 15/33] Fix a typo in a variable --- commands/info.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commands/info.js b/commands/info.js index 090a3da..8c1eea8 100644 --- a/commands/info.js +++ b/commands/info.js @@ -8,10 +8,10 @@ function Uptime (uptime) { const daystring = days + (days === 1 ? ' day' : ' days'); const hourstring = hours + (hours === 1 ? ' hour' : ' hours'); - const minutetring = minutes + (minutes === 1 ? ' minute' : ' minutes'); + const minutestring = minutes + (minutes === 1 ? ' minute' : ' minutes'); const secondstring = seconds + (seconds === 1 ? ' second' : ' seconds'); - return `${daystring}**, **${hourstring}**, **${minutetring}**, **${secondstring}`; + return `${daystring}**, **${hourstring}**, **${minutestring}**, **${secondstring}`; } const os = require('os'); From 8f2c8493bdf8b692ec0c411d7034ed0b872a4aa2 Mon Sep 17 00:00:00 2001 From: IDeletedSystem64 Date: Sun, 3 Jul 2022 18:12:53 -0500 Subject: [PATCH 16/33] Fix fatal problem where any user can stop the bot --- commands/stop.js | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/commands/stop.js b/commands/stop.js index a350649..1c2d07d 100644 --- a/commands/stop.js +++ b/commands/stop.js @@ -5,32 +5,31 @@ module.exports = { options: [], async parseMessage (client, config, message) { - await message.channel.send(await this.handle(client, config, message.author)); - process.exit(); + await this.handle(client, config, message.author, message.channel); }, async parseInteraction (client, config, interaction) { - await interaction.reply(await this.handle(client, config, interaction.user)); - process.exit(); + await this.handle(client, config, interaction.user, interaction.channel); }, - async handle (client, config, user) { + async handle (client, config, user, channel) { if (user.id === config.ownerID) { - console.log('[SYSTEM] [INFO] ' + ` The bot is going down for shut down. \nShutdown requested by ${user.username}`); - return { + console.log('[SYSTEM] [INFO] ' + `The bot is going down for shut down. \nShutdown requested by ${user.username}`); + await channel.send({ embeds: [{ title: '**Shut down the bot**', - description: ' **Shutting Down...**', + description: ':AnitroxWorking: **Shutting Down...**', color: 9442302, footer: { icon_url: user.displayAvatarURL(), text: config.footerTxt } }] - }; + }); + process.exit(); } else { console.error('[SYSTEM] [ERR] User ' + user.username + " tried to shut down the bot, but doesn't have permission! If this was you, Check your config.json"); - return client.generateErrorMessage('Only the bot owner can stop the bot! Stop.', user.displayAvatarURL()); + await channel.send(client.generateErrorMessage('You do not have permission to run this command.', user.displayAvatarURL())); } } }; From f54d22beb796a4fd2bbeaf97ff4b204ac49c7c53 Mon Sep 17 00:00:00 2001 From: IDeletedSystem64 Date: Sun, 3 Jul 2022 18:13:35 -0500 Subject: [PATCH 17/33] Change how No Permissions error is sent, add logging. --- commands/reload.js | 18 ++---------------- commands/restart.js | 2 +- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/commands/reload.js b/commands/reload.js index dab5b29..5684d5a 100644 --- a/commands/reload.js +++ b/commands/reload.js @@ -47,22 +47,8 @@ module.exports = { return returnMessage; } else { - return { - embeds: [{ - title: '<:AnitroxDenied:809651936642203668> **403 Forbidden**', - color: 13632027, - footer: { - icon_url: user.displayAvatarURL(), - text: config.footerTxt - }, - fields: [ - { - name: '**What Happened?**', - value: "You don't have the appropriate permissions to run this command!" - } - ] - }] - }; + console.error(`[SYSTEM] [ERR] User ${user.username} tried to reload ${args[0]}, but doesn't have permission!`); + return client.generateErrorMessage("You don't have permission to run this command.", user.displayAvatarURL()); } } }; diff --git a/commands/restart.js b/commands/restart.js index 0fd5ea8..992790d 100644 --- a/commands/restart.js +++ b/commands/restart.js @@ -43,7 +43,7 @@ module.exports = { } catch (e) { console.error(e); } } else { console.error('[SYSTEM] [ERR] User ' + user.username + " tried to restart the bot, but doesn't have permission! If this was you, Check your config.json"); - return client.generateErrorMessage('Only the bot owner can restart the bot! Stop.', user.displayAvatarURL()); + await channel.send(client.generateErrorMessage('You do not have permission to run this command.', user.displayAvatarURL())); } } }; From a740aadbdccc7294daa7551458e26fa39ea7d2bf Mon Sep 17 00:00:00 2001 From: IDeletedSystem64 Date: Sun, 3 Jul 2022 18:14:53 -0500 Subject: [PATCH 18/33] Version update --- config-example.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config-example.json b/config-example.json index a89d9ee..c5b8a2a 100644 --- a/config-example.json +++ b/config-example.json @@ -2,12 +2,12 @@ "prefix": "n!", "token": "IM SO EXCITED ABOUT BURGER", "ownerID": "MY FAVORITE COLOR IS TWELVE", - "release": "anitrox_dev", - "build": "Stable", + "release": "Stable Release", + "build": "1.2.2", "footerTxt": "Anitrox, made with <3 by IDeletedSystem64 | 2018-2022", "sandbox": { "enabled": false, - "id": "788391989460205571", + "id": "793537380330111028", "refreshLocal": false, "refreshGlobal": false }, From f5f94a1026229fd1bc62098c939a521fb14b01e2 Mon Sep 17 00:00:00 2001 From: IDeletedSystem64 Date: Mon, 4 Jul 2022 11:08:50 -0500 Subject: [PATCH 19/33] Fix the embed name returning an userID instead of username --- commands/uinfo.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/uinfo.js b/commands/uinfo.js index 438413a..106dbee 100644 --- a/commands/uinfo.js +++ b/commands/uinfo.js @@ -24,7 +24,7 @@ module.exports = { handle (client, config, user, target) { return { embeds: [{ - title: `Everything you've ever wanted to know about ${target}!`, + title: `Everything you've ever wanted to know about ${target.user.username}!`, color: 9442302, footer: { icon_url: user.displayAvatarURL(), From f67548a159e20df18f875d924ecf8c3db52783eb Mon Sep 17 00:00:00 2001 From: Sophie Marie Date: Mon, 4 Jul 2022 11:42:50 -0500 Subject: [PATCH 20/33] Delete embeds.json --- embeds.json | 1 - 1 file changed, 1 deletion(-) delete mode 100644 embeds.json diff --git a/embeds.json b/embeds.json deleted file mode 100644 index 8b13789..0000000 --- a/embeds.json +++ /dev/null @@ -1 +0,0 @@ - From 8d154b5e8a50a9015eca9d634f4e56b0bd189c6d Mon Sep 17 00:00:00 2001 From: IDeletedSystem64 Date: Mon, 4 Jul 2022 11:53:42 -0500 Subject: [PATCH 21/33] Make totalSeconds use process.uptime(); --- commands/info.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/info.js b/commands/info.js index 8c1eea8..7abff07 100644 --- a/commands/info.js +++ b/commands/info.js @@ -1,5 +1,5 @@ function Uptime (uptime) { - const totalSeconds = (uptime / 1000); + const totalSeconds = process.uptime(); const days = parseInt(totalSeconds / 86400); const hours = parseInt((totalSeconds % 86400) / 3600); From af6b091cda7cdee9a3b5952bf3d0e486f6266e50 Mon Sep 17 00:00:00 2001 From: Sophie Mondzelewski Date: Tue, 5 Jul 2022 11:51:30 -0500 Subject: [PATCH 22/33] Fix an oopsie poopsie, a fucky wucky! --- commands/stop.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/stop.js b/commands/stop.js index 1c2d07d..2eb4891 100644 --- a/commands/stop.js +++ b/commands/stop.js @@ -18,7 +18,7 @@ module.exports = { await channel.send({ embeds: [{ title: '**Shut down the bot**', - description: ':AnitroxWorking: **Shutting Down...**', + description: ' **Shutting Down...**', color: 9442302, footer: { icon_url: user.displayAvatarURL(), From 917d6a8c19d93e966652f7447577967d97b3f4fd Mon Sep 17 00:00:00 2001 From: Sophie Mondzelewski Date: Tue, 5 Jul 2022 11:55:42 -0500 Subject: [PATCH 23/33] Move uptime to a file, This is partially for logging --- functions/uptime.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 functions/uptime.js diff --git a/functions/uptime.js b/functions/uptime.js new file mode 100644 index 0000000..b10b8cf --- /dev/null +++ b/functions/uptime.js @@ -0,0 +1,17 @@ +module.exports = () => { + const tSeconds = process.uptime(); + + const tDays = parseInt(tSeconds / 86400); + const tHrs = parseInt((tSeconds % 86400) / 3600); + const tMins = parseInt((tSeconds % 3600) / 60); + const tSecs = parseInt(tSeconds % 60); + // We can probably just return tSeconds (totalSeconds) instead of parsing. + // So that was a fucking lie. + + const days = tDays + (tDays === 1 ? ' day' : ' days'); + const hours = tHrs + (tHrs === 1 ? ' hour' : ' hours'); + const minutes = tMins + (tMins === 1 ? ' minute' : ' hours'); + const seconds = tSecs + (tSecs === 1 ? ' second' : ' seconds'); + + return `${days}, ${hours}, ${minutes}, ${seconds}`; +}; From e378121fbe741726484d41fcf50d1f0ab1bfd253 Mon Sep 17 00:00:00 2001 From: Sophie Mondzelewski Date: Tue, 5 Jul 2022 12:28:31 -0500 Subject: [PATCH 24/33] Fix tSeconds making SystemUptime be the same as BotUptime --- events/ready.js | 1 + functions/uptime.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/events/ready.js b/events/ready.js index fac68ac..8447da3 100644 --- a/events/ready.js +++ b/events/ready.js @@ -46,6 +46,7 @@ module.exports = { console.log(' / /| | / __ \\/ / __/ ___/ __ \\| |/_/'); console.log(' / ___ |/ / / / / /_/ / / /_/ /> < '); console.log('/_/ |_/_/ /_/_/\\__/_/ \\____/_/|_| '); + console.log(''); console.log(`${config.release}, ${config.build}`); console.log('Bot online. | Anitrox by IDeletedSystem64 | ALL MY CODE KEEPS BLOWING UP!'); // Statuses diff --git a/functions/uptime.js b/functions/uptime.js index b10b8cf..7718eff 100644 --- a/functions/uptime.js +++ b/functions/uptime.js @@ -1,5 +1,5 @@ -module.exports = () => { - const tSeconds = process.uptime(); +module.exports = (uptime) => { + const tSeconds = (uptime / 1000); const tDays = parseInt(tSeconds / 86400); const tHrs = parseInt((tSeconds % 86400) / 3600); From 77517f6a168b1d29aedc06b65c38b3a2f8291d6d Mon Sep 17 00:00:00 2001 From: Sophie Mondzelewski Date: Tue, 5 Jul 2022 12:29:14 -0500 Subject: [PATCH 25/33] Make info use the new external function for uptime --- commands/info.js | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/commands/info.js b/commands/info.js index 7abff07..1392773 100644 --- a/commands/info.js +++ b/commands/info.js @@ -1,19 +1,4 @@ -function Uptime (uptime) { - const totalSeconds = process.uptime(); - - const days = parseInt(totalSeconds / 86400); - const hours = parseInt((totalSeconds % 86400) / 3600); - const minutes = parseInt((totalSeconds % 3600) / 60); - const seconds = parseInt(totalSeconds % 60); - - const daystring = days + (days === 1 ? ' day' : ' days'); - const hourstring = hours + (hours === 1 ? ' hour' : ' hours'); - const minutestring = minutes + (minutes === 1 ? ' minute' : ' minutes'); - const secondstring = seconds + (seconds === 1 ? ' second' : ' seconds'); - - return `${daystring}**, **${hourstring}**, **${minutestring}**, **${secondstring}`; -} - +const Uptime = require('../functions/uptime.js'); const os = require('os'); const osu = require('node-os-utils'); const cpu = osu.cpu; From 43f73c5403c76420c875630e06a9ffad7b6193a4 Mon Sep 17 00:00:00 2001 From: IDeletedSystem64 Date: Thu, 14 Jul 2022 12:49:54 -0500 Subject: [PATCH 26/33] Pass client to eval --- commands/eval.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/eval.js b/commands/eval.js index df12710..c7a88bc 100644 --- a/commands/eval.js +++ b/commands/eval.js @@ -20,7 +20,7 @@ module.exports = { await interaction.reply(this.handle(client, config, interaction.user, interaction.options.getString('code'))); }, - handle (_, config, user, code) { + handle (client, config, user, code) { if (user.id === config.ownerID) { try { const evaled = inspect(eval(code)); From dca559b36525e8c77dfe0551edf0310019c9b774 Mon Sep 17 00:00:00 2001 From: IDeletedSystem64 Date: Sat, 16 Jul 2022 12:10:37 -0500 Subject: [PATCH 27/33] Fix minutes displaying as hours --- functions/uptime.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions/uptime.js b/functions/uptime.js index 7718eff..ba0a557 100644 --- a/functions/uptime.js +++ b/functions/uptime.js @@ -10,7 +10,7 @@ module.exports = (uptime) => { const days = tDays + (tDays === 1 ? ' day' : ' days'); const hours = tHrs + (tHrs === 1 ? ' hour' : ' hours'); - const minutes = tMins + (tMins === 1 ? ' minute' : ' hours'); + const minutes = tMins + (tMins === 1 ? ' minute' : ' minutes'); const seconds = tSecs + (tSecs === 1 ? ' second' : ' seconds'); return `${days}, ${hours}, ${minutes}, ${seconds}`; From a50b45e78483cdef3bee9d1a7448f6e271da4d3c Mon Sep 17 00:00:00 2001 From: Sophie Marie Date: Mon, 18 Jul 2022 12:03:50 -0500 Subject: [PATCH 28/33] Rewrite bot info and embed (#59) --- commands/info.js | 156 ++++++++++++++++------------------------------- 1 file changed, 54 insertions(+), 102 deletions(-) diff --git a/commands/info.js b/commands/info.js index 1392773..565de1f 100644 --- a/commands/info.js +++ b/commands/info.js @@ -1,102 +1,54 @@ -const Uptime = require('../functions/uptime.js'); -const os = require('os'); -const osu = require('node-os-utils'); -const cpu = osu.cpu; - -module.exports = { - - name: require('path').parse(__filename).name, - description: 'Shows bot and host information', - options: [], - - async parseMessage (client, config, message) { - await message.channel.send(this.handle(client, config, message.author)); - }, - - async parseInteraction (client, config, interaction) { - await interaction.reply(this.handle(client, config, interaction.user)); - }, - - handle (client, config, user) { - return { - embeds: [{ - title: '<:AnitroxInfo:809651936831733791> Information about Anitrox', - description: "Everything you've ever wanted to know about your favorite bot, Anitrox!", - color: 9442302, - footer: { - icon_url: user.displayAvatarURL(), - text: config.footerTxt - }, - thumbnail: { - url: client.user.displayAvatarURL() - }, - fields: [ - { - name: 'Bot Information', - value: '** **' - }, - { - name: 'Release Type', - value: config.release, - inline: true - }, - { - name: 'Release Version', - value: config.build, - inline: true - }, - { - name: 'Uptime', - value: Uptime(client.uptime), - inline: true - }, - { - name: '<:memory:793536677737136178> Bot Memory Usage', - value: `${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2)} MiB`, - inline: true - }, - { - name: 'Bot Name', - value: client.user.tag, - inline: true - }, - { - name: 'Bot ID', - value: `\`${client.user.id}\``, - inline: true - }, - { - name: '<:hostinfo:793529505263517747> Host Information', - value: '** **' - }, - { - name: '<:hostinfo:793529505263517747> Host Uptime', - value: Uptime(os.uptime() * 1000) - }, - { - name: '<:cpu:793672442056802354> CPU Type', - value: `${process.arch}, ${cpu.model()}` - }, - - { - name: '<:hostos:793866961675223090> OS Type', - value: `${process.platform} / ${os.version()}` - }, - { - name: '<:node:793537507018145813> Node.JS Version', - value: process.version - }, - { - name: '<:hostinfo:793529505263517747> Bot Ping', - value: `${Math.round(client.ws.ping)} ms`, - inline: true - }, - { - name: '**Special Thanks To**', - value: '@OfficialTCGMatt for providing help with development\n @chuu_shi Allowing me to host Anitrox on his server' - } - ] - }] - }; - } -}; +const Uptime = require('../functions/uptime.js'); +const os = require('os'); +const osu = require('node-os-utils'); +const config = require('../config.json'); +module.exports = { + name: 'info', + description: 'Bot and System information', + options: [], + + async parseMessage (client, config, message) { + await message.channel.send(this.handle(client, config, message.author)); + }, + // We'll be moving solely to Slash Commands in 1.4 + + async parseInteraction (client, config, interaction) { + await interaction.reply(this.handle(client, config, interaction.user)); + }, + + handle (client, config, user) { + return { + embeds: [{ + title: `<:AnitroxInfo:809651936831733791> Information about ${client.user.username}`, + description: `Everything you've ever wanted to know about your favorite bot, ${client.user.username}!`, + color: 9442302, + footer: { + icon_url: user.displayAvatarURL(), + text: config.footerTxt + }, + thumbnail: { + url: client.user.displayAvatarURL() + }, + fields: [ + { name: '<:anitrox:831193012699791361> Bot Information', value: '** **' }, + { name: 'Bot Name', value: `${client.user.tag}`, inline: true }, + { name: 'Bot ID', value: `${client.user.id}`, inline: true }, + { name: 'Bot Owner', value: isNaN(config.ownerID) ? "Owner didn't set an OwnerID :(" : client.users.cache.get(config.ownerID).username, inline: true }, + { name: 'Release Type', value: config.release, inline: true }, + { name: 'Version', value: config.build, inline: true }, + { name: ':gear: Bot Process Information', value: '** **' }, + { name: '<:memory:997565609179107369> Bot Memory Usage', value: `${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2)} MiB`, inline: true }, + { name: ':timer: Bot Uptime', value: Uptime(client.uptime), inline: true }, + { name: ':one: Total Servers', value: `** **${client.guilds.cache.size}`, inline: true }, + { name: '<:hostinfo:997565639352926250> System Information', value: '** **' }, + { name: `${((process.platform === 'linux') ? '<:linux_tux:997565742960615424>' : '<:windows:997919047511453696>')} System Platform`, value: process.platform, inline: true }, + { name: `${((process.platform === 'linux') ? ':gear: Kernel Version' : ':gear: System Version')}`, value: os.release(), inline: true }, + { name: ':timer: System Uptime', value: Uptime(os.uptime() * 1000), inline: true }, + { name: '<:cpu:997565592028598282> System CPU Architecture', value: os.arch(), inline: true }, + { name: '<:cpu:997565592028598282> System CPU Model', value: osu.cpu.model(), inline: true }, + { name: '<:nodejs:998609124453531740> Node.js Version', value: process.version, inline: true } + ] + }] + }; + } +}; From 2661631c10dd7f360a61fc726bc3c6902c303d63 Mon Sep 17 00:00:00 2001 From: IDeletedSystem64 Date: Fri, 22 Jul 2022 20:47:35 -0500 Subject: [PATCH 29/33] Remove unneeded value --- commands/info.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/info.js b/commands/info.js index 565de1f..bc0ab78 100644 --- a/commands/info.js +++ b/commands/info.js @@ -1,7 +1,7 @@ const Uptime = require('../functions/uptime.js'); const os = require('os'); const osu = require('node-os-utils'); -const config = require('../config.json'); +// const config = require('../config.json'); module.exports = { name: 'info', description: 'Bot and System information', From 7541b53492f78dfeaacec07edd09010d7dfc1ee3 Mon Sep 17 00:00:00 2001 From: IDeletedSystem64 Date: Fri, 22 Jul 2022 21:40:18 -0500 Subject: [PATCH 30/33] Wait that was suppose to be removed, not a comment. --- commands/info.js | 1 - 1 file changed, 1 deletion(-) diff --git a/commands/info.js b/commands/info.js index bc0ab78..6906ecb 100644 --- a/commands/info.js +++ b/commands/info.js @@ -1,7 +1,6 @@ const Uptime = require('../functions/uptime.js'); const os = require('os'); const osu = require('node-os-utils'); -// const config = require('../config.json'); module.exports = { name: 'info', description: 'Bot and System information', From 09d14f7a7d58885c5cad35deff7daf089e0954b7 Mon Sep 17 00:00:00 2001 From: IDeletedSystem64 Date: Fri, 22 Jul 2022 21:51:16 -0500 Subject: [PATCH 31/33] Update support --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0de5cfd..89c204d 100644 --- a/README.md +++ b/README.md @@ -3,11 +3,11 @@ This is the stable branch, If you want the prepackaged and prepared builds, you're at the right place. # Dependencies to get started To begin, you will need to satisfy the following dependencies: -Node.JS: 14 +Node.JS: 16 npm: 6.14 # Let's get this ~~party~~ bot started! For first time start up, You will need to run ``npm install`` to install the needed npm packages. Afterwards fill out the ``config-example.json`` and rename it to ``config.json``, then just run ``node start.js`` (or ``./start.js`` on Linux)! ⚠️ If you don't specify the Owner ID, Some commands such as the bot controls will be unusable! # Support -Anitrox isn't really supported but you can get help from the Discord server if you need any: discord.gg/5nQtMNpf43 +Support is available on the [Discord Server!](discord.gg/5nQtMNpf43), or @ me on [Twitter!](twitter.com/IDeleteSystem64); From e1056c4d20fbbaf09161c8868aa10ef69be1bc33 Mon Sep 17 00:00:00 2001 From: IDeletedSystem64 Date: Fri, 22 Jul 2022 21:53:40 -0500 Subject: [PATCH 32/33] Add new dependencies: node-fetch, dotenv --- package.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package.json b/package.json index 4457737..8770d86 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,8 @@ "main": "start.js", "dependencies": { "discord.js": "^13.6.0", + "dotenv": "^16.0.1", + "node-fetch": "^3.2.9", "node-os-utils": "^1.3.2", "require-all": "^3.0.0" }, From d527cab9f5cd4f90e86ff75aca23c4c01f81177d Mon Sep 17 00:00:00 2001 From: IDeletedSystem64 Date: Tue, 26 Jul 2022 20:44:00 -0500 Subject: [PATCH 33/33] Refactor entire help command, unfinished. There are still a few thing's that need to be worked on, such as showing a category. This will rely on getting the parent folder of the command since I want to start categorizing everything like I should be to help make things easier to find. --- commands/help.js | 42 ++++++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/commands/help.js b/commands/help.js index 99ee3e5..77e7377 100644 --- a/commands/help.js +++ b/commands/help.js @@ -2,35 +2,45 @@ module.exports = { name: require('path').parse(__filename).name, description: 'Get help on anything from commands, to what the bot does! just not your homework..', - options: [], - - async parseMessage (client, config, message) { - await message.channel.send(this.handle(client, config, message.author)); + options: [{ + name: '', + description: 'View Information about this command', + required: false + }], + async parseMessage (client, config, message, args) { + await message.channel.send(this.handle(client, config, message.author, args)); }, async parseInteraction (client, config, interaction) { await interaction.reply(this.handle(client, config, interaction.user)); }, - handle (_, config, user) { + handle (client, config, user, args) { + if (!args[0]) { + return client.generateErrorMessage('Note to self: Design default help embed.', user.displayAvatarURL()); + } + + const cmdName = args[0].toLowerCase(); + const cmd = client.commands.get(cmdName); + + if (!cmd) { + return client.generateErrorMessage(`${cmdName} is not a valid command! Run ${config.prefix}help for a command list.`); + } return { embeds: [{ - title: 'HELP! SEYMOUR! THE BOT IS ON FIRE!', - description: 'Get help on anything from commands, to what the bot does! just not your homework..', color: 9442302, + title: ':question: Command Help', + description: `Everything you've ever wanted to know about ${cmdName}!`, footer: { icon_url: user.displayAvatarURL(), - text: `${config.footerTxt} | No mother it's just the northern lights` + text: config.footerTxt }, fields: [ - { - name: 'Command List', - value: '[Click here!](https://github.com/IDeletedSystem64/anitrox/blob/dev/commands.md)' - }, - { - name: '...Or is the bot actually on fire?', - value: 'Join the [support server!](https://discord.gg/grebRGsBZ3)' - } + { name: 'Command Name', value: `${cmdName}`, inline: true }, + { name: 'Command Description', value: cmd.description, inline: true }, + { name: 'Command Options', value: cmd.options.map(option => option.name).join('\n') || 'None', inline: true }, + { name: 'Command Option Description', value: cmd.options.map(option => option.description).join('\n') || 'None', inline: true }, + { name: 'Option Legend', value: '[Option] REQUIRED\n