From aaae385763d01a03fe6e93cbeab9f78c9c16fe48 Mon Sep 17 00:00:00 2001 From: Nathaniel Mason Date: Tue, 29 Mar 2022 19:55:44 +0100 Subject: [PATCH] use config param instead of require --- commands/info.js | 6 ++---- commands/restart.js | 4 +--- commands/stop.js | 2 +- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/commands/info.js b/commands/info.js index 4707580..4ae2ae4 100644 --- a/commands/info.js +++ b/commands/info.js @@ -1,5 +1,3 @@ -const {build, release} = require('../config.json'); - module.exports = { name: 'info', @@ -43,12 +41,12 @@ module.exports = { }, { "name": "Release Type", - "value": release, + "value": config.release, "inline": true }, { "name": "Release Version", - "value": build, + "value": config.build, "inline": true }, { diff --git a/commands/restart.js b/commands/restart.js index 2cd54c2..237e03c 100644 --- a/commands/restart.js +++ b/commands/restart.js @@ -1,5 +1,3 @@ -const { token } = require('../config.json'); - module.exports = { name: 'restart', description: '(Owner Only) Shuts down the bot.', @@ -8,7 +6,7 @@ module.exports = { await message.channel.send(" Restarting...") try { client.destroy(); - await client.login(token); + await client.login(config.token); await message.channel.send("<:NyabotSuccess:697211376740859914> Restart Successful") console.log("All systems go") } catch(e) {console.log(e);} diff --git a/commands/stop.js b/commands/stop.js index 95188bc..5fa179c 100644 --- a/commands/stop.js +++ b/commands/stop.js @@ -1,7 +1,7 @@ module.exports = { name: "stop", description: "IT'S TIME TO STOP!... the bot", - async execute(client, message, config) { + async execute(_, message, config) { if (message.author.id == config.ownerID) { await message.channel.send({embed: { "title": " **Shutting Down...**",