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'); 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())); } } }; 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())); } } }; 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 },