From 268ceb9c4aab213ef0d415f3f4dfbcaa699ab95c Mon Sep 17 00:00:00 2001 From: IDeletedSystem64 Date: Mon, 28 Mar 2022 12:39:27 -0500 Subject: [PATCH] Move everything to use config --- start.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/start.js b/start.js index b63d7f7..8ea0b95 100755 --- a/start.js +++ b/start.js @@ -20,7 +20,7 @@ client.generateErrorMessage = (errorMsg, messageAuthorURL) => ({embed: { "color": 13632027, "footer": { "icon_url": messageAuthorURL, - "text": footerTxt + "text": config.footerTxt }, "fields": [ { @@ -41,21 +41,22 @@ client.once('ready', () => { console.log('/_/ |_/_/ /_/_/\\__/_/ \\____/_/|_| '); console.log(`${config.release}, ${config.build}`); console.log("Bot online. | Anitrox by IDeletedSystem64 | ALL MY CODE KEEPS BLOWING UP!"); + // Statuses + setInterval(async () => { + // Picks a status from the config file + const index = Math.floor(Math.random() * config.statuses.length); + await client.user.setActivity(config.statuses[index]); + }, 20000); + }); -setInterval(async () => { - // Picks a status from the config file - const index = Math.floor(Math.random() * config.statuses.length); - await client.user.setActivity(statuses[index]); -}, 20000); - // Begin Command Handler client.on('message', async (message) => { - if (!message.content.startsWith(prefix) || message.author.bot) return; + if (!message.content.startsWith(config.prefix) || message.author.bot) return; - const args = message.content.slice(prefix.length).split(/ +/); + const args = message.content.slice(config.prefix.length).split(/ +/); const command = args.shift().toLowerCase(); if (!client.commands.has(command)) return;