From 976ba50c38340c4921a72fb74b399bba93f6df75 Mon Sep 17 00:00:00 2001 From: IDeletedSystem64 Date: Mon, 28 Mar 2022 10:56:21 -0500 Subject: [PATCH] Move config to a single variable and pass it. --- start.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/start.js b/start.js index 117f0c0..b63d7f7 100755 --- a/start.js +++ b/start.js @@ -2,8 +2,8 @@ const fs = require('fs'); const Discord = require('discord.js'); -const { statuses, build, release, prefix, token, footerTxt } = require('./config.json'); - +// const { statuses, build, release, prefix, token, footerTxt } = require('./config.json'); +const config = require('./config.json'); console.log('Starting!') const client = new Discord.Client(); client.commands = new Discord.Collection(); @@ -24,7 +24,7 @@ client.generateErrorMessage = (errorMsg, messageAuthorURL) => ({embed: { }, "fields": [ { - "name": "Well that happened...", + "name": "Something went wrong!", "value": errorMsg } ] @@ -39,14 +39,14 @@ client.once('ready', () => { console.log(' / /| | / __ \\/ / __/ ___/ __ \\| |/_/'); console.log(' / ___ |/ / / / / /_/ / / /_/ /> < '); console.log('/_/ |_/_/ /_/_/\\__/_/ \\____/_/|_| '); - console.log(`${release}, ${build}`); - console.log("All Systems Go. | Anitrox by IDeletedSystem64 | ALL MY CODE KEEPS BLOWING UP!"); + console.log(`${config.release}, ${config.build}`); + console.log("Bot online. | Anitrox by IDeletedSystem64 | ALL MY CODE KEEPS BLOWING UP!"); }); setInterval(async () => { // Picks a status from the config file - const index = Math.floor(Math.random() * statuses.length); + const index = Math.floor(Math.random() * config.statuses.length); await client.user.setActivity(statuses[index]); }, 20000); @@ -61,7 +61,7 @@ client.on('message', async (message) => { if (!client.commands.has(command)) return; try { - await client.commands.get(command).execute(client, message, args, footerTxt); + await client.commands.get(command).execute(client, message, args, config); } catch (error) { console.stack; message.channel.send({embed: { @@ -70,10 +70,10 @@ client.on('message', async (message) => { "color": 13632027, "footer": { "icon_url": message.author.displayAvatarURL(), - "text": footerTxt + "text": config.footerTxt }, }}); } }); -client.login(token); \ No newline at end of file +client.login(config.token); \ No newline at end of file