From 6c10d32fd52c7c1acce20b9b48f28466c962a4c0 Mon Sep 17 00:00:00 2001 From: Nathaniel Mason Date: Sat, 26 Mar 2022 08:58:15 +0000 Subject: [PATCH] slightly nicer handling of the embed's footer --- commands/8ball.js | 13 +++---------- commands/avatar.js | 9 +++------ commands/bonk.js | 7 ++----- commands/cheese.js | 7 ++----- commands/cuddle.js | 7 ++----- commands/eval.js | 7 ++----- commands/help.js | 7 ++----- commands/hug.js | 7 ++----- commands/info.js | 7 ++----- commands/invite.js | 8 ++------ commands/kiss.js | 12 +++--------- commands/leskiss.js | 12 +++--------- commands/lick.js | 12 +++--------- commands/nom.js | 12 +++--------- commands/opensource.js | 7 ++----- commands/pat.js | 12 +++--------- commands/ping.js | 7 ++----- commands/poke.js | 12 +++--------- commands/reload.js | 7 ++----- commands/restart.js | 3 +-- commands/setnick.js | 12 +++--------- commands/slap.js | 12 +++--------- commands/snuggle.js | 12 +++--------- commands/stop.js | 12 +++--------- commands/uinfo.js | 7 ++----- start.js | 13 +++++++------ 26 files changed, 68 insertions(+), 175 deletions(-) diff --git a/commands/8ball.js b/commands/8ball.js index 664e557..b06b971 100644 --- a/commands/8ball.js +++ b/commands/8ball.js @@ -25,7 +25,7 @@ module.exports = { name: '8ball', description: 'Ask Anitrox a question, any question! and they will answer it!', syntax: ["[Question]"], - async execute(_, message, args, footerTxt) { + async execute(_, message, args, footer) { const answer = answers[Math.floor(Math.random() * Object.keys(answers).length)]; const question = args.slice(0).join(" ") console.log(args); @@ -35,21 +35,14 @@ module.exports = { "title": "<:AnitroxError:809651936563429416> **Something went wrong!**", "description": "You need to ask a question!", "color": 13632027, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - } + "footer": footer })); } else { await message.channel.send(new MessageEmbed({ "title": ":8ball: Anitrox 8 Ball", "description": "Your question: **" + question + "**", "color": 9442302, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - }, - + "footer": footer, "fields": [ { "name": "🤔 My Answer", diff --git a/commands/avatar.js b/commands/avatar.js index 3b1f1a7..7d4ab07 100644 --- a/commands/avatar.js +++ b/commands/avatar.js @@ -1,20 +1,17 @@ const { MessageEmbed } = require('discord.js'); module.exports = { - + name: "avatar", description: "Gets a user's avatar.", - async execute(_0, message, _1, footerTxt) { + async execute(_0, message, _1, footer) { const user = message.mentions.users.first() || message.author; await message.channel.send(new MessageEmbed({ "title": ":frame_photo: " + user.username + "'s Beautiful Avatar!", "color": 9442302, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - }, + "footer": footer, "image": { "url": user.displayAvatarURL() } diff --git a/commands/bonk.js b/commands/bonk.js index 613b253..cd7b524 100644 --- a/commands/bonk.js +++ b/commands/bonk.js @@ -4,7 +4,7 @@ module.exports = { name: "bonk", description: "Bonks a user!", - async execute(_0, message, _1, footerTxt) { + async execute(_0, message, _1, footer) { const taggedUser = message.mentions.users.first(); if(!taggedUser) { @@ -27,10 +27,7 @@ module.exports = { "title": " Bonk", "description": "<@" + taggedUser + ">" + " You have been bonked by <@" + message.author + ">!", "color": 9442302, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - }, + "footer": footer, "image": { "url": "https://cdn.discordapp.com/attachments/793537380330111028/801194481549312060/HappyBONK.gif" } diff --git a/commands/cheese.js b/commands/cheese.js index d4c007f..f6cd89e 100644 --- a/commands/cheese.js +++ b/commands/cheese.js @@ -3,7 +3,7 @@ const { MessageEmbed } = require("discord.js"); 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, footer) { const taggedUser = message.mentions.users.first(); if(!taggedUser) { await message.channel.send("*slams cheese on desk* Cheese. https://www.youtube.com/watch?v=Or4IE8fkpn4"); @@ -12,10 +12,7 @@ module.exports = { "title": ":cheese: Cheesed", "description": "<@" + taggedUser + ">" + " You got cheesed by " + "<@" + message.author + ">!", "color": 16312092, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - }, + "footer": footer, "image": { "url": "https://cdn.discordapp.com/attachments/803658122299572255/812867714368536636/R06325af354168febcafd96b8328b7590.png" } diff --git a/commands/cuddle.js b/commands/cuddle.js index 6896a40..0eec8d3 100644 --- a/commands/cuddle.js +++ b/commands/cuddle.js @@ -11,7 +11,7 @@ module.exports = { name: "cuddle", description: "Cuddle an user!", - async execute(_0, message, _1, footerTxt) { + async execute(_0, message, _1, footer) { const taggedUser = message.mentions.users.first(); const index = Math.floor(Math.random() * gifchoices.length); @@ -24,10 +24,7 @@ module.exports = { "title": ":heart: Cuddle", "description": "<@" + taggedUser + ">" + " You have been cuddled by " + "<@" + message.author + ">!", "color": 9442302, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - }, + "footer": footer, "image": { "url": gif } diff --git a/commands/eval.js b/commands/eval.js index f4c1b0b..543e340 100644 --- a/commands/eval.js +++ b/commands/eval.js @@ -5,7 +5,7 @@ module.exports = { name: 'eval', description: 'Runs js code', - async execute(_, message, args, footerTxt) { + async execute(_, message, args, footer) { if (message.author.id == 309427567004483586 || message.author.id == 475558313376088064) { try { const code = args.join(" "); @@ -15,10 +15,7 @@ module.exports = { await message.channel.send(new MessageEmbed({ "title": "<:NyabotError:697145462347661412> **Well that happened...**", "color": 13632027, - "footer": { - "icon_url": "https://images-ext-2.discordapp.net/external/-qaO3jaZLojhEnjrHiKABdXD7gLWqFvdUqHdskNGWhE/https/media.discordapp.net/attachments/549707869138714635/793524910172667964/Screenshot_26.png", - "text": footerTxt - }, + "footer": footer, "fields": [ { "name": "**What Happened?**", diff --git a/commands/help.js b/commands/help.js index 747478e..465e857 100644 --- a/commands/help.js +++ b/commands/help.js @@ -6,15 +6,12 @@ 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, footer) { await message.channel.send(new MessageEmbed({ "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" - }, + "footer": footer, "fields": [ { "name": "Command List", diff --git a/commands/hug.js b/commands/hug.js index acb1a8f..5934d0f 100644 --- a/commands/hug.js +++ b/commands/hug.js @@ -12,7 +12,7 @@ module.exports = { name: "hug", description: "Hugs a user!", - async execute(_0, message, _1, footerTxt) { + async execute(_0, message, _1, footer) { const taggedUser = message.mentions.users.first(); if(!taggedUser) { @@ -36,10 +36,7 @@ module.exports = { "title": " Hug", "description": "<@" + taggedUser + ">" + " You have been hugged by " + "<@" + message.author + ">!", "color": 8311585, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - }, + "footer": footer, "image": { "url": gif } diff --git a/commands/info.js b/commands/info.js index 88be741..3a249bb 100644 --- a/commands/info.js +++ b/commands/info.js @@ -5,7 +5,7 @@ module.exports = { name: 'info', description: 'Shows bot and host information', - async execute(client, message, _, footerTxt) { + async execute(client, message, _, footer) { function Uptime(uptime) { const totalSeconds = (uptime / 1000); @@ -30,10 +30,7 @@ module.exports = { "title": "<:AnitroxInfo:809651936831733791> Information about Anitrox", "description": "Everything you've ever wanted to know about your favorite bot, Anitrox!", "color": 9442302, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - }, + "footer": footer, "thumbnail": { "url": client.user.displayAvatarURL() }, diff --git a/commands/invite.js b/commands/invite.js index 08bcd58..72aabdd 100644 --- a/commands/invite.js +++ b/commands/invite.js @@ -5,15 +5,12 @@ module.exports = { name: 'invite', description: 'Add Anitrox to your beautiful server!', syntax: [], - async execute(_0, message, _1, footerTxt) { + async execute(_0, message, _1, footer) { await message.channel.send(new MessageEmbed({ "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 - }, + "footer": footer, "thumbnail": { "url": "https://cdn.discordapp.com/attachments/803658122299572255/814352905394061322/anitroxaddsrvr.png" }, @@ -30,7 +27,6 @@ module.exports = { "name": "Need help?", "value": "Come join the Anitrox Support Server, for support and much more!\n [Anitrox Support Server](https://discord.gg/grebRGsBZ3)" } - ] })); }, diff --git a/commands/kiss.js b/commands/kiss.js index eb5c159..7f8b6e0 100644 --- a/commands/kiss.js +++ b/commands/kiss.js @@ -12,17 +12,14 @@ module.exports = { name: "kiss", description: "Kisses a user!", - async execute(_0, message, _1, footerTxt) { + async execute(_0, message, _1, footer) { const taggedUser = message.mentions.users.first(); if(!taggedUser) { await message.channel.send(new MessageEmbed({ "title": "<:AnitroxError:809651936563429416> Error", "color": 13632027, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - }, + "footer": footer, "fields": [ { "name": "Well that happened...", @@ -36,10 +33,7 @@ module.exports = { "title": ":heart: Kiss", "description": "<@" + taggedUser + ">" + ", You have been kissed by <@" + message.author + ">!", "color": 9442302, - "footer": { - "icon_url": "https://media.discordapp.net/attachments/549707869138714635/793524910172667964/Screenshot_26.png", - "text": "Made with ❤ in Illinois | Anitrox © IDeletedSystem64 2018-2021" - }, + "footer": footer, "image": { "url": gif } diff --git a/commands/leskiss.js b/commands/leskiss.js index 57c3735..b257ce0 100644 --- a/commands/leskiss.js +++ b/commands/leskiss.js @@ -22,17 +22,14 @@ module.exports = { name: "leskiss", description: "Lesbian kiss <:lesbian:803831629428686849>", - async execute(_0, message, _1, footerTxt) { + async execute(_0, message, _1, footer) { const taggedUser = message.mentions.users.first(); if(!taggedUser) { await message.channel.send(new MessageEmbed({ "title": "<:AnitroxError:809651936563429416> Error", "color": 9442302, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - }, + "footer": footer, "fields": [ { "name": "Well that happened...", @@ -46,10 +43,7 @@ module.exports = { "title": ":heart: <:lesbian:803831629428686849> Kiss", "description": "<@" + taggedUser + ">" + " You have been kissed by <@" + message.author + ">! <:lesbian:803831629428686849>", "color": 8311585, - "footer": { - "icon_url": "https://media.discordapp.net/attachments/549707869138714635/793524910172667964/Screenshot_26.png", - "text": "Made with ❤ in Illinois | Anitrox © IDeletedSystem64 2018-2021" - }, + "footer": footer, "image": { "url": gif } diff --git a/commands/lick.js b/commands/lick.js index 01ebbd9..907ce3b 100644 --- a/commands/lick.js +++ b/commands/lick.js @@ -11,17 +11,14 @@ module.exports = { name: "lick", description: "Licks an user!", - async execute(_0, message, _1, footerTxt) { + async execute(_0, message, _1, footer) { const taggedUser = message.mentions.users.first(); if(!taggedUser) { await message.channel.send(new MessageEmbed({ "title": "<:AnitroxError:809651936563429416> Error", "color": 9442302, - "footer": { - "icon_url": "https://images-ext-2.discordapp.net/external/-qaO3jaZLojhEnjrHiKABdXD7gLWqFvdUqHdskNGWhE/https/media.discordapp.net/attachments/549707869138714635/793524910172667964/Screenshot_26.png", - "text": "Made with ❤ in Illinois | Anitrox © 2018-2021 IDeletedSystem64" - }, + "footer": footer, "fields": [ { "name": "Well that happened...", @@ -35,10 +32,7 @@ module.exports = { "title": " Lick", "description": "<@" + taggedUser + "> You have been licked by <@" + message.author + ">!", "color": 8311585, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - }, + "footer": footer, "image": { "url": "https://cdn.discordapp.com/attachments/803658122299572255/805314244123951114/cef569820773b0f5d54ee34cfa18e1f8.gif" } diff --git a/commands/nom.js b/commands/nom.js index 96b6975..fe862dc 100644 --- a/commands/nom.js +++ b/commands/nom.js @@ -11,17 +11,14 @@ module.exports = { name: "nom", description: "Noms an user!", - async execute(_0, message, _1, footerTxt) { + async execute(_0, message, _1, footer) { const taggedUser = message.mentions.users.first(); if(!taggedUser) { await message.channel.send(new MessageEmbed({ "title": "<:AnitroxError:809651936563429416> Error", "color": 9442302, - "footer": { - "icon_url": "https://images-ext-2.discordapp.net/external/-qaO3jaZLojhEnjrHiKABdXD7gLWqFvdUqHdskNGWhE/https/media.discordapp.net/attachments/549707869138714635/793524910172667964/Screenshot_26.png", - "text": "Made with ❤ in Illinois | Anitrox by IDeletedSystem64" - }, + "footer": footer, "fields": [ { "name": "Well that happened...", @@ -35,10 +32,7 @@ module.exports = { "title": "<:BlobNomBlob:801241117919805510> Nom", "description": "<@" + taggedUser + "> You have been nommed by <@" + messageAuthor + ">!", "color": 8311585, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - }, + "footer": footer, "image": { "url": gif } diff --git a/commands/opensource.js b/commands/opensource.js index 8a5fe3f..096128a 100644 --- a/commands/opensource.js +++ b/commands/opensource.js @@ -3,15 +3,12 @@ const { MessageEmbed } = require("discord.js"); module.exports = { name: 'opensource', description: 'Attributions to open source components used by Anitrox', - async execute(_0, message, _1, footerTxt){ + async execute(_0, message, _1, footer){ await message.channel.send(new MessageEmbed({ "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 - }, + "footer": footer, "thumbnail": { "url": "https://cdn.discordapp.com/attachments/803658122299572255/838854256471703602/793885335498522685.png" }, diff --git a/commands/pat.js b/commands/pat.js index 6a6fb66..cc1ab0b 100644 --- a/commands/pat.js +++ b/commands/pat.js @@ -10,17 +10,14 @@ module.exports = { name: "pat", description: "Pats a user!", - async execute(_0, message, _1, footerTxt) { + async execute(_0, message, _1, footer) { const taggedUser = message.mentions.users.first(); if(!taggedUser) { await message.channel.send(new MessageEmbed({ "title": "<:AnitroxError:809651936563429416> Error", "color": 9442302, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - }, + "footer": footer, "fields": [ { "name": "Well that happened...", @@ -34,10 +31,7 @@ module.exports = { "title": "<:pats:801238281286713355> Pat", "description": "<@" + taggedUser + "> You have been patted by <@" + messageAuthor + ">!", "color": 8311585, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - }, + "footer": footer, "image": { "url": gif } diff --git a/commands/ping.js b/commands/ping.js index f1923a4..6e46014 100644 --- a/commands/ping.js +++ b/commands/ping.js @@ -4,7 +4,7 @@ const { locations } = require('../config.json'); module.exports = { name: "ping", description: "Gets bot ping", - async execute(client, message, _, footerTxt) { + async execute(client, message, _, footer) { const index = Math.floor(Math.random() * locations.length); const pingLocation = locations[index] @@ -12,10 +12,7 @@ module.exports = { "title": ":ping_pong: Ping", "description": "**Pong!** We pinged **" + pingLocation + "** and got " + client.ws.ping + " ms.", "color": 9442302, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - } + "footer": footer })); } }; diff --git a/commands/poke.js b/commands/poke.js index 4f961ce..ee133b7 100644 --- a/commands/poke.js +++ b/commands/poke.js @@ -10,17 +10,14 @@ module.exports = { name: "poke", description: "Pokes an user!", - async execute(_0, message, _1, footerTxt) { + async execute(_0, message, _1, footer) { const taggedUser = message.mentions.users.first(); if(!taggedUser) { await message.channel.send(new MessageEmbed({ "title": "<:AnitroxError:809651936563429416> Error", "color": 9442302, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - }, + "footer": footer, "fields": [ { "name": "Well that happened...", @@ -34,10 +31,7 @@ module.exports = { "title": "👉 Poke!", "description": "<@" + taggedUser + "> You have been poked by <@" + message.author + ">!", "color": 8311585, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - }, + "footer": footer, "image": { "url": gif } diff --git a/commands/reload.js b/commands/reload.js index 36360d9..a9c9754 100644 --- a/commands/reload.js +++ b/commands/reload.js @@ -4,7 +4,7 @@ module.exports = { name: 'reload', description: 'Reloads a command', args: true, - async execute(client, message, args, footerTxt) { + async execute(client, message, args, footer) { if (message.author.id == 309427567004483586 || message.author.id == 475558313376088064) { const commandName = args[0].toLowerCase(); const command = message.client.commands.get(commandName) @@ -29,10 +29,7 @@ module.exports = { message.channel.send(new MessageEmbed({ "title": "<:NyabotDenied:697145462565896194> **Access is denied**", "color": 13632027, - "footer": { - "icon_url": "https://cdn.discordapp.com/attachments/549707869138714635/793524910172667964/Screenshot_26.png", - "text": footerTxt - }, + "footer": footer, "fields": [ { "name": "**What Happened?**", diff --git a/commands/restart.js b/commands/restart.js index 38d1228..2cd54c2 100644 --- a/commands/restart.js +++ b/commands/restart.js @@ -1,10 +1,9 @@ const { token } = require('../config.json'); -const Discord = require('discord.js'); module.exports = { name: 'restart', description: '(Owner Only) Shuts down the bot.', - async execute(client, message, args) { + async execute(client, message) { if (message.author.id == 309427567004483586 || message.author.id == 475558313376088064) { await message.channel.send(" Restarting...") try { diff --git a/commands/setnick.js b/commands/setnick.js index dac383e..43238ba 100644 --- a/commands/setnick.js +++ b/commands/setnick.js @@ -3,7 +3,7 @@ const { MessageEmbed } = require("discord.js"); module.exports = { name: 'setnick', description: 'Sets your nickname', - async execute(_, message, args, footerTxt) { + async execute(_, message, args, footer) { if (message.channel.permissionsFor(message.author).has("CHANGE_NICKNAME")) { const newnick = args.slice(0).join(" ") @@ -13,10 +13,7 @@ module.exports = { await message.channel.send(new MessageEmbed({ "title": "<:AnitroxSuccess:809651936819019796> Nickname Changed", "color": 9442302, - "footer": { - "icon_url": "https://images-ext-2.discordapp.net/external/-qaO3jaZLojhEnjrHiKABdXD7gLWqFvdUqHdskNGWhE/https/media.discordapp.net/attachments/549707869138714635/793524910172667964/Screenshot_26.png", - "text": footerTxt - }, + "footer": footer, "fields": [ { "name": "Changed nickname successfully!", @@ -33,10 +30,7 @@ module.exports = { await message.channel.send(new MessageEmbed({ "title": "<:AnitroxDenied:809651936642203668> Well that happened...", "color": 13632027, - "footer": { - "icon_url": "https://cdn.discordapp.com/embed/avatars/0.png", - "text": footerTxt - }, + "footer": footer, "fields": [ { "name": "Failed to set nickname", diff --git a/commands/slap.js b/commands/slap.js index 44aee4d..75ad264 100644 --- a/commands/slap.js +++ b/commands/slap.js @@ -4,17 +4,14 @@ module.exports = { name: "slap", description: "Slaps an user!", - async execute(_0, message, _1, footerTxt) { + async execute(_0, message, _1, footer) { const taggedUser = message.mentions.users.first(); if(!taggedUser) { await message.channel.send(new MessageEmbed({ "title": "<:AnitroxError:809651936563429416> Error", "color": 13632027, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - }, + "footer": footer, "fields": [ { "name": "Well that happened...", @@ -27,10 +24,7 @@ module.exports = { "title": ":anger: Slap", "description": "<@" + taggedUser + "> You have been slapped by <@" + messageAuthor + ">!", "color": 9442302, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - }, + "footer": footer, "image": { "url": "https://media1.tenor.com/images/b6d8a83eb652a30b95e87cf96a21e007/tenor.gif?itemid=10426943" } diff --git a/commands/snuggle.js b/commands/snuggle.js index ab58a1f..02d894f 100644 --- a/commands/snuggle.js +++ b/commands/snuggle.js @@ -11,17 +11,14 @@ module.exports = { name: "snuggle", description: "Snuggle an user!", - async execute(_0, message, _1, footerTxt) { + async execute(_0, message, _1, footer) { const taggedUser = message.mentions.users.first(); if(!taggedUser) { await message.channel.send(new MessageEmbed({ "title": "<:AnitroxError:809651936563429416> Error", "color": 13632027, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - }, + "footer": footer, "fields": [ { "name": "Well that happened...", @@ -34,10 +31,7 @@ module.exports = { "title": "<:BlobSnuggleCat:806759753450782731> Snuggle", "description": "<@" + taggedUser + ">" + " You have been snuggled by " + "<@" + messageAuthor + ">!", "color": 9442302, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - }, + "footer": footer, "image": { "url": gif } diff --git a/commands/stop.js b/commands/stop.js index 5251e0a..467b45a 100644 --- a/commands/stop.js +++ b/commands/stop.js @@ -3,16 +3,13 @@ const { MessageEmbed } = require("discord.js"); module.exports = { name: "stop", description: "Stops the bot", - async execute(client, message, _, footerTxt) { + async execute(client, message, _, footer) { if (message.author.id == 309427567004483586 || message.author.id == 475558313376088064) { await message.channel.send(new MessageEmbed({ "title": " **Shutting Down...**", "description": "See you next time!", "color": 9442302, - "footer": { - "icon_url": "https://media.discordapp.net/attachments/549707869138714635/793524910172667964/Screenshot_26.png", - "text": footerTxt - } + "footer": footer })); client.destroy(); } else { @@ -20,10 +17,7 @@ module.exports = { "title": ":AnitroxDenied: Access Denied", "description": "You need to be the bot owner to execute this command!", "color": 13632027, - "footer": { - "icon_url": "https://media.discordapp.net/attachments/549707869138714635/793524910172667964/Screenshot_26.png", - "text": footerTxt - } + "footer": footer })); } } diff --git a/commands/uinfo.js b/commands/uinfo.js index b1cb7dc..02ff83b 100644 --- a/commands/uinfo.js +++ b/commands/uinfo.js @@ -4,16 +4,13 @@ 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, footer) { console.log(args[0]) const user = message.mentions.users.first() || client.users.cache.get(args[0]) || message.author await message.channel.send(new MessageEmbed({ "title": "Everything you've ever wanted to know about " + user.username + "!", "color": 9442302, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt - }, + "footer": footer, "thumbnail": { "url": user.displayAvatarURL() }, diff --git a/start.js b/start.js index 11694bf..9ae17ca 100755 --- a/start.js +++ b/start.js @@ -4,6 +4,11 @@ const fs = require('fs'); const Discord = require('discord.js'); const { statuses, build, release, prefix, token, footerTxt } = require('./config.json'); +const embedFooter = { + "icon_url": "https://cdn.discordapp.com/attachments/549707869138714635/793524910172667964/Screenshot_26.png", + "text": footerTxt +} + console.log('Starting!') const client = new Discord.Client(); client.commands = new Discord.Collection(); @@ -17,7 +22,6 @@ for (const file of commandFiles) { client.on("error", (e) => console.log("[ERROR]" + error(e))); client.on("warn", (e) => ("[WARN]" + warn(e))); -// Log errors to console. client.once('ready', () => { console.clear() console.log(' ___ _ __ '); @@ -47,17 +51,14 @@ 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, embedFooter); } catch (error) { console.stack; message.channel.send(new Discord.MessageEmbed({ "title": "<:AnitroxError:809651936563429416> **Something went wrong!**", "description": error.stack, "color": 13632027, - "footer": { - "icon_url": message.author.displayAvatarURL(), - "text": footerTxt + " | Something went wrong! :(" - } + "footer": footer })); } });