diff --git a/commands/avatar.js b/commands/avatar.js index 5db6668..356265b 100644 --- a/commands/avatar.js +++ b/commands/avatar.js @@ -2,7 +2,7 @@ module.exports = { name: "avatar", description: "Gets a user's avatar.", - async execute(client, message, args, footerTxt) { + async execute(client, message, args, config) { const user = message.mentions.users.first() || client.users.cache.get(args[0]) || message.author; @@ -11,7 +11,7 @@ module.exports = { "color": 9442302, "footer": { "icon_url": message.author.displayAvatarURL(), - "text": footerTxt + "text": config.footerTxt }, "image": { "url": user.displayAvatarURL() diff --git a/commands/bonk.js b/commands/bonk.js index ab0a7c4..d4d984c 100644 --- a/commands/bonk.js +++ b/commands/bonk.js @@ -2,7 +2,7 @@ module.exports = { name: "bonk", description: "Bonks a user!", - async execute(client, message, _, footerTxt) { + async execute(client, message, _, config) { const taggedUser = message.mentions.users.first(); if(!taggedUser) { @@ -14,7 +14,7 @@ module.exports = { "color": 9442302, "footer": { "icon_url": message.author.displayAvatarURL(), - "text": footerTxt + "text": config.footerTxt }, "image": { "url": "https://cdn.discordapp.com/attachments/793537380330111028/801194481549312060/HappyBONK.gif" diff --git a/commands/cheese.js b/commands/cheese.js index ff3da46..88516d2 100644 --- a/commands/cheese.js +++ b/commands/cheese.js @@ -1,7 +1,7 @@ module.exports = { name: "cheese", description: "Cheese an user, or run just ``n!cheese`` for a surprise :eyes:", - async execute(_0, message, _1, footerTxt) { + async execute(_0, message, _1, config) { const taggedUser = message.mentions.users.first(); if(!taggedUser) { await message.channel.send("*slams cheese on desk*\n**Cheese.** https://www.youtube.com/watch?v=Or4IE8fkpn4"); @@ -12,7 +12,7 @@ module.exports = { "color": 16312092, "footer": { "icon_url": message.author.displayAvatarURL(), - "text": footerTxt + "text": config.footerTxt }, "image": { "url": "https://cdn.discordapp.com/attachments/803658122299572255/812867714368536636/R06325af354168febcafd96b8328b7590.png" diff --git a/commands/cuddle.js b/commands/cuddle.js index 35f0183..d14cb10 100644 --- a/commands/cuddle.js +++ b/commands/cuddle.js @@ -9,7 +9,7 @@ module.exports = { name: "cuddle", description: "Cuddle an user!", - async execute(client, message, _, footerTxt) { + async execute(client, message, _, config) { const taggedUser = message.mentions.users.first(); const index = Math.floor(Math.random() * gifchoices.length); @@ -24,7 +24,7 @@ module.exports = { "color": 9442302, "footer": { "icon_url": message.author.displayAvatarURL(), - "text": footerTxt + "text": config.footerTxt }, "image": { "url": gif diff --git a/commands/help.js b/commands/help.js index 1a622fa..940501b 100644 --- a/commands/help.js +++ b/commands/help.js @@ -4,14 +4,14 @@ module.exports = { description: 'Get help on anything from commands, to what the bot does! just not your homework..', syntax: '', - async execute(_0, message, _1, footerTxt) { + async execute(_0, message, _1, config) { await message.channel.send({embed: { "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, "footer": { "icon_url": message.author.displayAvatarURL(), - "text": `${footerTxt} | No mother it's just the northern lights` + "text": `${config.footerTxt} | No mother it's just the northern lights` }, "fields": [ { diff --git a/commands/hug.js b/commands/hug.js index 1d95374..a4ddf72 100644 --- a/commands/hug.js +++ b/commands/hug.js @@ -10,7 +10,7 @@ module.exports = { name: "hug", description: "Hugs a user!", - async execute(client, message, _, footerTxt) { + async execute(client, message, _, config) { const taggedUser = message.mentions.users.first(); if(!taggedUser) { @@ -23,7 +23,7 @@ module.exports = { "color": 8311585, "footer": { "icon_url": message.author.displayAvatarURL(), - "text": footerTxt + "text": config.footerTxt }, "image": { "url": gif diff --git a/commands/info.js b/commands/info.js index e0ee274..4ae2ae4 100644 --- a/commands/info.js +++ b/commands/info.js @@ -1,10 +1,8 @@ -const {build, release} = require('../config.json'); - module.exports = { - name: 'info', - description: 'Shows bot and host information', - async execute(client, message, _, footerTxt) { + name: 'info', + description: 'Shows bot and host information', + async execute(client, message, _, config) { function Uptime(uptime) { const totalSeconds = (uptime / 1000); @@ -31,7 +29,7 @@ module.exports = { "color": 9442302, "footer": { "icon_url": message.author.displayAvatarURL(), - "text": footerTxt + "text": config.footerTxt }, "thumbnail": { "url": client.user.displayAvatarURL() @@ -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/invite.js b/commands/invite.js index ce04d12..873e385 100644 --- a/commands/invite.js +++ b/commands/invite.js @@ -1,16 +1,16 @@ module.exports = { - name: 'invite', - description: 'Add Anitrox to your beautiful server!', - syntax: [], - async execute(_0, message, _1, footerTxt) { + name: 'invite', + description: 'Add Anitrox to your beautiful server!', + syntax: [], + async execute(_0, message, _1, config) { await message.channel.send({embed: { "title": "Add Anitrox to your Server!", "description": "Weather you want stable, or that squeaky clean fresh PTB build, we gotchu.", "color": 9442302, "footer": { "icon_url": message.author.displayAvatarURL(), - "text": footerTxt + "text": config.footerTxt }, "thumbnail": { "url": "https://cdn.discordapp.com/attachments/803658122299572255/814352905394061322/anitroxaddsrvr.png" @@ -30,5 +30,5 @@ module.exports = { } ] }}); - }, + }, }; \ No newline at end of file diff --git a/commands/kiss.js b/commands/kiss.js index 10e76ec..6b51e9a 100644 --- a/commands/kiss.js +++ b/commands/kiss.js @@ -10,7 +10,7 @@ module.exports = { name: "kiss", description: "Kisses a user!", - async execute(client, message, _, footerTxt) { + async execute(client, message, _, config) { const taggedUser = message.mentions.users.first(); if(!taggedUser) { @@ -23,7 +23,7 @@ module.exports = { "color": 9442302, "footer": { "icon_url": message.author.displayAvatarURL(), - "text": footerTxt + "text": config.footerTxt }, "image": { "url": gif diff --git a/commands/leskiss.js b/commands/leskiss.js index 703ef79..18242c4 100644 --- a/commands/leskiss.js +++ b/commands/leskiss.js @@ -20,7 +20,7 @@ module.exports = { name: "leskiss", description: "Lesbian kiss <:lesbian:803831629428686849>", - async execute(client, message, _, footerTxt) { + async execute(client, message, _, config) { const taggedUser = message.mentions.users.first(); if(!taggedUser) { @@ -33,7 +33,7 @@ module.exports = { "color": 8311585, "footer": { "icon_url": message.author.displayAvatarURL(), - "text": footerTxt + "text": config.footerTxt }, "image": { "url": gif diff --git a/commands/lick.js b/commands/lick.js index 3764f95..f3573ac 100644 --- a/commands/lick.js +++ b/commands/lick.js @@ -9,7 +9,7 @@ module.exports = { name: "lick", description: "Licks a user!", - async execute(client, message, _, footerTxt) { + async execute(client, message, _, config) { const taggedUser = message.mentions.users.first(); if(!taggedUser) { @@ -22,7 +22,7 @@ module.exports = { "color": 8311585, "footer": { "icon_url": message.author.displayAvatarURL(), - "text": footerTxt + "text": config.footerTxt }, "image": { "url": "https://cdn.discordapp.com/attachments/803658122299572255/805314244123951114/cef569820773b0f5d54ee34cfa18e1f8.gif" diff --git a/commands/nom.js b/commands/nom.js index 73684b7..1ace929 100644 --- a/commands/nom.js +++ b/commands/nom.js @@ -9,7 +9,7 @@ module.exports = { name: "nom", description: "Noms an user!", - async execute(client, message, _, footerTxt) { + async execute(client, message, _, config) { const taggedUser = message.mentions.users.first(); if(!taggedUser) { @@ -22,7 +22,7 @@ module.exports = { "color": 8311585, "footer": { "icon_url": message.author.displayAvatarURL(), - "text": footerTxt + "text": config.footerTxt }, "image": { "url": gif diff --git a/commands/opensource.js b/commands/opensource.js index 8b14c43..762a6c1 100644 --- a/commands/opensource.js +++ b/commands/opensource.js @@ -1,14 +1,14 @@ module.exports = { name: 'opensource', description: 'Attributions to open source components used by Anitrox', - async execute(_0, message, _1, footerTxt){ + async execute(_0, message, _1, config){ await message.channel.send({embed: { "title": "Component Attribution", "description": "Some parts of Anitrox are using open source code, and their attributions are avaliable here!", "color": 52508, "footer": { "icon_url": message.author.displayAvatarURL(), - "text": footerTxt + "text": config.footerTxt }, "thumbnail": { "url": "https://cdn.discordapp.com/attachments/803658122299572255/838854256471703602/793885335498522685.png" diff --git a/commands/pat.js b/commands/pat.js index b943223..1d818a0 100644 --- a/commands/pat.js +++ b/commands/pat.js @@ -8,7 +8,7 @@ module.exports = { name: "pat", description: "Pats a user!", - async execute(client, message, _, footerTxt) { + async execute(client, message, _, config) { const taggedUser = message.mentions.users.first(); if(!taggedUser) { @@ -21,7 +21,7 @@ module.exports = { "color": 8311585, "footer": { "icon_url": message.author.displayAvatarURL(), - "text": footerTxt + "text": config.footerTxt }, "image": { "url": gif diff --git a/commands/ping.js b/commands/ping.js index b12e186..77f9544 100644 --- a/commands/ping.js +++ b/commands/ping.js @@ -1,7 +1,7 @@ module.exports = { name: "ping", description: "Gets bot ping", - async execute(client, message, args, config) { + async execute(client, message, _, config) { const index = Math.floor(Math.random() * config.locations.length); const location = config.locations[index] diff --git a/commands/poke.js b/commands/poke.js index 2e77288..46584ba 100644 --- a/commands/poke.js +++ b/commands/poke.js @@ -8,7 +8,7 @@ module.exports = { name: "poke", description: "Pokes a user!", - async execute(client, message, _, footerTxt) { + async execute(client, message, _, config) { const taggedUser = message.mentions.users.first(); if(!taggedUser) { @@ -21,7 +21,7 @@ module.exports = { "color": 8311585, "footer": { "icon_url": message.author.displayAvatarURL(), - "text": footerTxt + "text": config.footerTxt }, "image": { "url": gif diff --git a/commands/reload.js b/commands/reload.js index f91bbb8..84de5cd 100644 --- a/commands/reload.js +++ b/commands/reload.js @@ -34,7 +34,7 @@ module.exports = { "color": 13632027, "footer": { "icon_url": message.author.displayAvatarURL(), - "text": footerTxt + "text": config.footerTxt }, "fields": [ { @@ -43,6 +43,6 @@ module.exports = { } ] }}); - } - } + } + } }; \ No newline at end of file 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/setnick.js b/commands/setnick.js index efa1e1c..3569904 100644 --- a/commands/setnick.js +++ b/commands/setnick.js @@ -1,7 +1,7 @@ module.exports = { name: 'setnick', description: 'Sets your nickname', - async execute(client, message, args, footerTxt) { + async execute(client, message, args, config) { if (message.channel.permissionsFor(message.author).has("CHANGE_NICKNAME")) { const newnick = args.slice(0).join(" ") @@ -13,7 +13,7 @@ module.exports = { "color": 9442302, "footer": { "icon_url": message.author.displayAvatarURL(), - "text": footerTxt + "text": config.footerTxt }, "fields": [ { diff --git a/commands/slap.js b/commands/slap.js index 4fc6e9c..8e1d41b 100644 --- a/commands/slap.js +++ b/commands/slap.js @@ -2,7 +2,7 @@ module.exports = { name: "slap", description: "Slaps an user!", - async execute(client, message, _, footerTxt) { + async execute(client, message, _, config) { const taggedUser = message.mentions.users.first(); if(!taggedUser) { @@ -14,7 +14,7 @@ module.exports = { "color": 9442302, "footer": { "icon_url": message.author.displayAvatarURL(), - "text": footerTxt + "text": config.footerTxt }, "image": { "url": "https://media1.tenor.com/images/b6d8a83eb652a30b95e87cf96a21e007/tenor.gif?itemid=10426943" diff --git a/commands/snuggle.js b/commands/snuggle.js index 6d6285b..cda8b8a 100644 --- a/commands/snuggle.js +++ b/commands/snuggle.js @@ -9,7 +9,7 @@ module.exports = { name: "snuggle", description: "Snuggle an user!", - async execute(client, message, _, footerTxt) { + async execute(client, message, _, config) { const taggedUser = message.mentions.users.first(); if(!taggedUser) { @@ -22,7 +22,7 @@ module.exports = { "color": 9442302, "footer": { "icon_url": message.author.displayAvatarURL(), - "text": footerTxt + "text": config.footerTxt }, "image": { "url": gif 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...**", diff --git a/commands/uinfo.js b/commands/uinfo.js index 527e3fd..f7427a0 100644 --- a/commands/uinfo.js +++ b/commands/uinfo.js @@ -2,14 +2,14 @@ module.exports = { name: "uinfo", description: "Gets info about an user, such as ID, Discord Join date and more", syntax: "", - async execute(client, message, args, footerTxt) { + async execute(client, message, args, config) { const user = message.mentions.users.first() || client.users.cache.get(args[0]) || message.author await message.channel.send({embed: { "title": `Everything you've ever wanted to know about ${user.username}!`, "color": 9442302, "footer": { "icon_url": message.author.displayAvatarURL(), - "text": footerTxt + "text": config.footerTxt }, "thumbnail": { "url": user.displayAvatarURL() diff --git a/start.js b/start.js index 8ea0b95..9dfde1a 100755 --- a/start.js +++ b/start.js @@ -2,7 +2,6 @@ const fs = require('fs'); const Discord = require('discord.js'); -// const { statuses, build, release, prefix, token, footerTxt } = require('./config.json'); const config = require('./config.json'); console.log('Starting!') const client = new Discord.Client(); @@ -11,8 +10,8 @@ client.commands = new Discord.Collection(); const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js')); for (const file of commandFiles) { - const command = require(`./commands/${file}`); - client.commands.set(command.name, command); + const command = require(`./commands/${file}`); + client.commands.set(command.name, command); } client.generateErrorMessage = (errorMsg, messageAuthorURL) => ({embed: { @@ -73,8 +72,8 @@ client.on('message', async (message) => { "icon_url": message.author.displayAvatarURL(), "text": config.footerTxt }, - }}); - } + }}); + } }); client.login(config.token); \ No newline at end of file