new error embed generator + some more patches

This commit is contained in:
Nathaniel Mason 2022-03-26 17:31:03 +00:00
parent 66ef27b8e6
commit 4d51f2b5a7
25 changed files with 195 additions and 222 deletions

View file

@ -23,24 +23,21 @@ module.exports = {
name: '8ball',
description: 'Ask Anitrox a question, any question! and they will answer it!',
syntax: ["[Question]"],
async execute(_, message, args, footer) {
async execute(client, message, args, footerTxt) {
const answer = answers[Math.floor(Math.random() * Object.keys(answers).length)];
const question = args.slice(0).join(" ")
console.log(args);
if (!question) {
await message.channel.send({embed: {
"title": "<:AnitroxError:809651936563429416> **Something went wrong!**",
"description": "You need to ask a question!",
"color": 13632027,
"footer": footer
}});
await message.channel.send(client.generateErrorMessage("You need to ask a question!", message.author.displayAvatarURL));
} else {
await message.channel.send({embed: {
"title": ":8ball: Anitrox 8 Ball",
"description": "Your question: **" + question + "**",
"color": 9442302,
"footer": footer,
"footer": {
"icon_url": message.author.displayAvatarURL(),
"text": footerTxt
},
"fields": [
{
"name": "🤔 My Answer",

View file

@ -2,14 +2,17 @@ module.exports = {
name: "avatar",
description: "Gets a user's avatar.",
async execute(_0, message, _1, footer) {
async execute(client, message, args, footerTxt) {
const user = message.mentions.users.first() || message.author;
const user = message.mentions.users.first() || client.users.cache.get(args[0]) || message.author;
await message.channel.send({embed: {
"title": ":frame_photo: " + user.username + "'s Beautiful Avatar!",
"color": 9442302,
"footer": footer,
"footer": {
"icon_url": message.author.displayAvatarURL(),
"text": footerTxt
},
"image": {
"url": user.displayAvatarURL()
}

View file

@ -2,30 +2,20 @@ module.exports = {
name: "bonk",
description: "Bonks a user!",
async execute(_0, message, _1, footer) {
async execute(client, message, _, footerTxt) {
const taggedUser = message.mentions.users.first();
if(!taggedUser) {
await message.channel.send({embed: {
"title": "<:AnitroxError:809651936563429416> Error",
"color": 13632027,
"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"
},
"fields": [
{
"name": "Well that happened...",
"value": "You need to @mention an user!"
}
]
}});
await message.channel.send(client.generateErrorMessage("You need to @mention a user!", message.author.displayAvatarURL()));
} else {
await message.channel.send({embed: {
"title": "<a:SylvBonk:801185845847130113> Bonk",
"description": "<@" + taggedUser + ">" + " You have been bonked by <@" + message.author + ">!",
"color": 9442302,
"footer": footer,
"footer": {
"icon_url": message.author.displayAvatarURL(),
"text": footerTxt
},
"image": {
"url": "https://cdn.discordapp.com/attachments/793537380330111028/801194481549312060/HappyBONK.gif"
}

View file

@ -1,16 +1,19 @@
module.exports = {
name: "cheese",
description: "Cheese an user, or run just ``n!cheese`` for a surprise :eyes:",
async execute(_0, message, _1, footer) {
async execute(_0, message, _1, footerTxt) {
const taggedUser = message.mentions.users.first();
if(!taggedUser) {
await message.channel.send("*slams cheese on desk* Cheese. https://www.youtube.com/watch?v=Or4IE8fkpn4");
await message.channel.send("*slams cheese on desk*\n**Cheese.** https://www.youtube.com/watch?v=Or4IE8fkpn4");
} else {
await message.channel.send({embed: {
"title": ":cheese: Cheesed",
"description": "<@" + taggedUser + ">" + " You got cheesed by " + "<@" + message.author + ">!",
"color": 16312092,
"footer": footer,
"footer": {
"icon_url": message.author.displayAvatarURL(),
"text": footerTxt
},
"image": {
"url": "https://cdn.discordapp.com/attachments/803658122299572255/812867714368536636/R06325af354168febcafd96b8328b7590.png"
}

View file

@ -9,20 +9,23 @@ module.exports = {
name: "cuddle",
description: "Cuddle an user!",
async execute(_0, message, _1, footer) {
async execute(client, message, _, footerTxt) {
const taggedUser = message.mentions.users.first();
const index = Math.floor(Math.random() * gifchoices.length);
const gif = (gifchoices[index]);
if(!taggedUser) {
await message.channel.send("<:AnitroxError:809651936563429416> You need to specify an user!");
await message.channel.send(client.generateErrorMessage("You need to @mention a user!", message.author.displayAvatarURL()));
} else {
await message.channel.send({embed: {
"title": ":heart: Cuddle",
"description": "<@" + taggedUser + ">" + " You have been cuddled by " + "<@" + message.author + ">!",
"color": 9442302,
"footer": footer,
"footer": {
"icon_url": message.author.displayAvatarURL(),
"text": footerTxt
},
"image": {
"url": gif
}

View file

@ -4,7 +4,7 @@ module.exports = {
name: 'eval',
description: 'Runs js code',
async execute(_, message, args, footer) {
async execute(_, message, args, footerTxt) {
if (message.author.id == 309427567004483586 || message.author.id == 475558313376088064) {
try {
const code = args.join(" ");
@ -14,7 +14,10 @@ module.exports = {
await message.channel.send({embed: {
"title": "<:NyabotError:697145462347661412> **Well that happened...**",
"color": 13632027,
"footer": footer,
"footer": {
"icon_url": message.author.displayAvatarURL(),
"text": footerTxt
},
"fields": [
{
"name": "**What Happened?**",

View file

@ -4,12 +4,15 @@ module.exports = {
description: 'Get help on anything from commands, to what the bot does! just not your homework..',
syntax: '<Command>',
async execute(_0, message, _1, footer) {
async execute(_0, message, _1, footerTxt) {
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": footer,
"footer": {
"icon_url": message.author.displayAvatarURL(),
"text": footerTxt + " | No mother it's just the northern lights"
},
"fields": [
{
"name": "Command List",

View file

@ -10,31 +10,21 @@ module.exports = {
name: "hug",
description: "Hugs a user!",
async execute(_0, message, _1, footer) {
async execute(client, message, _, footerTxt) {
const taggedUser = message.mentions.users.first();
if(!taggedUser) {
await message.channel.send({embed: {
"title": "<:AnitroxError:809651936563429416> Error",
"color": 9442302,
"footer": {
"icon_url": message.author.displayAvatarURL(),
"text": message.author.displayAvatarURL()
},
"fields": [
{
"name": "Well that happened...",
"value": "You need to @mention an user!"
}
]
}});
await message.channel.send(client.generateErrorMessage("You need to @mention a user!", message.author.displayAvatarURL()));
} else {
const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)];
await message.channel.send({embed: {
"title": "<a:ABlobCatHuggle:801232248035999784> Hug",
"description": "<@" + taggedUser + ">" + " You have been hugged by " + "<@" + message.author + ">!",
"color": 8311585,
"footer": footer,
"footer": {
"icon_url": message.author.displayAvatarURL(),
"text": footerTxt
},
"image": {
"url": gif
}

View file

@ -4,7 +4,7 @@ module.exports = {
name: 'info',
description: 'Shows bot and host information',
async execute(client, message, _, footer) {
async execute(client, message, _, footerTxt) {
function Uptime(uptime) {
const totalSeconds = (uptime / 1000);
@ -29,7 +29,10 @@ module.exports = {
"title": "<:AnitroxInfo:809651936831733791> Information about Anitrox",
"description": "Everything you've ever wanted to know about your favorite bot, Anitrox!",
"color": 9442302,
"footer": footer,
"footer": {
"icon_url": message.author.displayAvatarURL(),
"text": footerTxt
},
"thumbnail": {
"url": client.user.displayAvatarURL()
},

View file

@ -3,12 +3,15 @@ module.exports = {
name: 'invite',
description: 'Add Anitrox to your beautiful server!',
syntax: [],
async execute(_0, message, _1, footer) {
async execute(_0, message, _1, footerTxt) {
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": footer,
"footer": {
"icon_url": message.author.displayAvatarURL(),
"text": footerTxt
},
"thumbnail": {
"url": "https://cdn.discordapp.com/attachments/803658122299572255/814352905394061322/anitroxaddsrvr.png"
},

View file

@ -10,28 +10,21 @@ module.exports = {
name: "kiss",
description: "Kisses a user!",
async execute(_0, message, _1, footer) {
async execute(client, message, _, footerTxt) {
const taggedUser = message.mentions.users.first();
if(!taggedUser) {
await message.channel.send({embed: {
"title": "<:AnitroxError:809651936563429416> Error",
"color": 13632027,
"footer": footer,
"fields": [
{
"name": "Well that happened...",
"value": "You need to @mention an user!"
}
]
}});
await message.channel.send(client.generateErrorMessage("You need to @mention a user!", message.author.displayAvatarURL()));
} else {
const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)];
await message.channel.send({embed: {
"title": ":heart: Kiss",
"description": "<@" + taggedUser + ">" + ", You have been kissed by <@" + message.author + ">!",
"color": 9442302,
"footer": footer,
"footer": {
"icon_url": message.author.displayAvatarURL(),
"text": footerTxt
},
"image": {
"url": gif
}

View file

@ -20,28 +20,21 @@ module.exports = {
name: "leskiss",
description: "Lesbian kiss <:lesbian:803831629428686849>",
async execute(_0, message, _1, footer) {
async execute(client, message, _, footerTxt) {
const taggedUser = message.mentions.users.first();
if(!taggedUser) {
await message.channel.send({embed: {
"title": "<:AnitroxError:809651936563429416> Error",
"color": 9442302,
"footer": footer,
"fields": [
{
"name": "Well that happened...",
"value": "You need to @mention an user!"
}
]
}});
await message.channel.send(client.generateErrorMessage("You need to @mention a user!", message.author.displayAvatarURL()));
} else {
const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)];
await message.channel.send({embed: {
"title": ":heart: <:lesbian:803831629428686849> Kiss",
"description": "<@" + taggedUser + ">" + " You have been kissed by <@" + message.author + ">! <:lesbian:803831629428686849>",
"color": 8311585,
"footer": footer,
"footer": {
"icon_url": message.author.displayAvatarURL(),
"text": footerTxt
},
"image": {
"url": gif
}

View file

@ -8,29 +8,22 @@ const gifchoices = [
module.exports = {
name: "lick",
description: "Licks an user!",
async execute(_0, message, _1, footer) {
description: "Licks a user!",
async execute(client, message, _, footerTxt) {
const taggedUser = message.mentions.users.first();
if(!taggedUser) {
await message.channel.send({embed: {
"title": "<:AnitroxError:809651936563429416> Error",
"color": 9442302,
"footer": footer,
"fields": [
{
"name": "Well that happened...",
"value": "You need to @mention an user!"
}
]
}});
await message.channel.send(client.generateErrorMessage("You need to @mention a user!", message.author.displayAvatarURL()));
} else {
const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)];
await message.channel.send({embed: {
"title": "<a:LeafeonLick:806396195089154058> Lick",
"description": "<@" + taggedUser + "> You have been licked by <@" + message.author + ">!",
"color": 8311585,
"footer": footer,
"footer": {
"icon_url": message.author.displayAvatarURL(),
"text": footerTxt
},
"image": {
"url": "https://cdn.discordapp.com/attachments/803658122299572255/805314244123951114/cef569820773b0f5d54ee34cfa18e1f8.gif"
}

View file

@ -9,28 +9,21 @@ module.exports = {
name: "nom",
description: "Noms an user!",
async execute(_0, message, _1, footer) {
async execute(client, message, _, footerTxt) {
const taggedUser = message.mentions.users.first();
if(!taggedUser) {
await message.channel.send({embed: {
"title": "<:AnitroxError:809651936563429416> Error",
"color": 9442302,
"footer": footer,
"fields": [
{
"name": "Well that happened...",
"value": "You need to @mention an user!"
}
]
}});
await message.channel.send(client.generateErrorMessage("You need to @mention a user!", message.author.displayAvatarURL()));
} else {
const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)];
await message.channel.send({embed: {
"title": "<:BlobNomBlob:801241117919805510> Nom",
"description": "<@" + taggedUser + "> You have been nommed by <@" + messageAuthor + ">!",
"description": "<@" + taggedUser + "> You have been nommed by <@" + message.author + ">!",
"color": 8311585,
"footer": footer,
"footer": {
"icon_url": message.author.displayAvatarURL(),
"text": footerTxt
},
"image": {
"url": gif
}

View file

@ -1,12 +1,15 @@
module.exports = {
name: 'opensource',
description: 'Attributions to open source components used by Anitrox',
async execute(_0, message, _1, footer){
async execute(_0, message, _1, footerTxt){
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": footer,
"footer": {
"icon_url": message.author.displayAvatarURL(),
"text": footerTxt
},
"thumbnail": {
"url": "https://cdn.discordapp.com/attachments/803658122299572255/838854256471703602/793885335498522685.png"
},

View file

@ -8,28 +8,21 @@ module.exports = {
name: "pat",
description: "Pats a user!",
async execute(_0, message, _1, footer) {
async execute(client, message, _, footerTxt) {
const taggedUser = message.mentions.users.first();
if(!taggedUser) {
await message.channel.send({embed: {
"title": "<:AnitroxError:809651936563429416> Error",
"color": 9442302,
"footer": footer,
"fields": [
{
"name": "Well that happened...",
"value": "You need to @mention an user!"
}
]
}});
await message.channel.send(client.generateErrorMessage("You need to @mention a user!", message.author.displayAvatarURL()));
} else {
const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)];
await message.channel.send({embed: {
"title": "<:pats:801238281286713355> Pat",
"description": "<@" + taggedUser + "> You have been patted by <@" + messageAuthor + ">!",
"description": "<@" + taggedUser + "> You have been patted by <@" + message.author + ">!",
"color": 8311585,
"footer": footer,
"footer": {
"icon_url": message.author.displayAvatarURL(),
"text": footerTxt
},
"image": {
"url": gif
}

View file

@ -3,7 +3,7 @@ const { locations } = require('../config.json');
module.exports = {
name: "ping",
description: "Gets bot ping",
async execute(client, message, _, footer) {
async execute(client, message, _, footerTxt) {
const index = Math.floor(Math.random() * locations.length);
const pingLocation = locations[index]
@ -11,7 +11,10 @@ module.exports = {
"title": ":ping_pong: Ping",
"description": "**Pong!** We pinged **" + pingLocation + "** and got " + client.ws.ping + " ms.",
"color": 9442302,
"footer": footer
"footer": {
"icon_url": message.author.displayAvatarURL(),
"text": footerTxt
}
}});
}
};

View file

@ -7,29 +7,22 @@ const gifchoices = [
module.exports = {
name: "poke",
description: "Pokes an user!",
async execute(_0, message, _1, footer) {
description: "Pokes a user!",
async execute(client, message, _, footerTxt) {
const taggedUser = message.mentions.users.first();
if(!taggedUser) {
await message.channel.send({embed: {
"title": "<:AnitroxError:809651936563429416> Error",
"color": 9442302,
"footer": footer,
"fields": [
{
"name": "Well that happened...",
"value": "You need to @mention an user!"
}
]
}});
await message.channel.send(client.generateErrorMessage("You need to @mention a user!", message.author.displayAvatarURL()));
} else {
const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)];
await message.channel.send({embed: {
"title": "👉 Poke!",
"description": "<@" + taggedUser + "> You have been poked by <@" + message.author + ">!",
"color": 8311585,
"footer": footer,
"footer": {
"icon_url": message.author.displayAvatarURL(),
"text": footerTxt
},
"image": {
"url": gif
}

View file

@ -1,33 +1,41 @@
module.exports = {
name: 'reload',
description: 'Reloads a command',
args: true,
async execute(client, message, args, footer) {
async execute(client, message, args, footerTxt) {
if (message.author.id == 309427567004483586 || message.author.id == 475558313376088064) {
const commandName = args[0].toLowerCase();
const command = message.client.commands.get(commandName)
|| message.client.commands.find(cmd => cmd.aliases && cmd.aliases.includes(commandName));
if (!command) {
await message.channel.send(`There is no command with name or alias \`${commandName}\`, ${message.author}!`);
} else {
delete require.cache[require.resolve(`./${command.name}.js`)];
try {
const newCommand = require(`./${command.name}.js`);
client.commands.set(newCommand.name, newCommand);
await message.channel.send(`<:NyabotSuccess:697211376740859914> **Reloaded \`${command.name}\` successfully!**`);
console.log(`User reloaded ${command.name}.`)
} catch (error) {
console.error(error);
await message.channel.send(`<:AnitroxError:809651936563429416> There was an error while reloading \`${command.name}\`:\n\`${error.message}\``);
}
if (!args.length) {
await message.channel.send(client.generateErrorMessage("You forgot to provide anything to reload, you pillock",message.author.displayAvatarURL()));
}
args.forEach(async (arg) => {
const commandName = arg.toLowerCase();
const command = message.client.commands.get(commandName)
|| message.client.commands.find(cmd => cmd.aliases && cmd.aliases.includes(commandName));
if (!command) {
await message.channel.send(client.generateErrorMessage(`There is no command with name or alias \`${commandName}\`, ${message.author}!`,message.author.displayAvatarURL()));
} else {
delete require.cache[require.resolve(`./${command.name}.js`)];
try {
const newCommand = require(`./${command.name}.js`);
client.commands.set(newCommand.name, newCommand);
await message.channel.send(`<:NyabotSuccess:697211376740859914> **Reloaded \`${command.name}\` successfully!**`);
console.log(`User reloaded ${command.name}.`)
} catch (error) {
console.error(error);
await message.channel.send(client.generateErrorMessage(`There was an error while reloading \`${command.name}\`:\n\`${error.message}\``, message.author.displayAvatarURL()));
}
}
});
} else {
message.channel.send({embed: {
"title": "<:NyabotDenied:697145462565896194> **Access is denied**",
"color": 13632027,
"footer": footer,
"footer": {
"icon_url": message.author.displayAvatarURL(),
"text": footerTxt
},
"fields": [
{
"name": "**What Happened?**",

View file

@ -1,7 +1,7 @@
module.exports = {
name: 'setnick',
description: 'Sets your nickname',
async execute(_, message, args, footer) {
async execute(client, message, args, footerTxt) {
if (message.channel.permissionsFor(message.author).has("CHANGE_NICKNAME")) {
const newnick = args.slice(0).join(" ")
@ -11,7 +11,10 @@ module.exports = {
await message.channel.send({embed: {
"title": "<:AnitroxSuccess:809651936819019796> Nickname Changed",
"color": 9442302,
"footer": footer,
"footer": {
"icon_url": message.author.displayAvatarURL(),
"text": footerTxt
},
"fields": [
{
"name": "Changed nickname successfully!",
@ -25,18 +28,10 @@ module.exports = {
]
}});
} catch (error) {
await message.channel.send({embed: {
"title": "<:AnitroxDenied:809651936642203668> Well that happened...",
"color": 13632027,
"footer": footer,
"fields": [
{
"name": "Failed to set nickname",
"value": "You need to have permission ``CHANGE_NICKNAME`` to change your nick!"
}
]
}});
await message.channel.send(client.generateErrorMessage("Failed to set user nickname. Does the bot have the correct permissions?", message.author.displayAvatarURL()));
};
};
} else {
await message.channel.send(client.generateErrorMessage("You need to have permission ``CHANGE_NICKNAME`` to change your nick!", message.author.displayAvatarURL()));
}
}
}

View file

@ -2,27 +2,20 @@ module.exports = {
name: "slap",
description: "Slaps an user!",
async execute(_0, message, _1, footer) {
async execute(client, message, _, footerTxt) {
const taggedUser = message.mentions.users.first();
if(!taggedUser) {
await message.channel.send({embed: {
"title": "<:AnitroxError:809651936563429416> Error",
"color": 13632027,
"footer": footer,
"fields": [
{
"name": "Well that happened...",
"value": "You need to @mention an user!"
}
]
}});
await message.channel.send(client.generateErrorMessage("You need to @mention a user!", message.author.displayAvatarURL()));
} else {
await message.channel.send({embed: {
"title": ":anger: Slap",
"description": "<@" + taggedUser + "> You have been slapped by <@" + messageAuthor + ">!",
"description": "<@" + taggedUser + "> You have been slapped by <@" + message.author + ">!",
"color": 9442302,
"footer": footer,
"footer": {
"icon_url": message.author.displayAvatarURL(),
"text": footerTxt
},
"image": {
"url": "https://media1.tenor.com/images/b6d8a83eb652a30b95e87cf96a21e007/tenor.gif?itemid=10426943"
}

View file

@ -9,27 +9,21 @@ module.exports = {
name: "snuggle",
description: "Snuggle an user!",
async execute(_0, message, _1, footer) {
async execute(client, message, _, footerTxt) {
const taggedUser = message.mentions.users.first();
if(!taggedUser) {
await message.channel.send({embed: {
"title": "<:AnitroxError:809651936563429416> Error",
"color": 13632027,
"footer": footer,
"fields": [
{
"name": "Well that happened...",
"value": "You need to @mention an user!"
}
]
}});
await message.channel.send(client.generateErrorMessage("You need to @mention a user!", message.author.displayAvatarURL()));
} else {
const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)];
await message.channel.send({embed: {
"title": "<:BlobSnuggleCat:806759753450782731> Snuggle",
"description": "<@" + taggedUser + ">" + " You have been snuggled by " + "<@" + messageAuthor + ">!",
"description": "<@" + taggedUser + ">" + " You have been snuggled by " + "<@" + message.author + ">!",
"color": 9442302,
"footer": footer,
"footer": {
"icon_url": message.author.displayAvatarURL(),
"text": footerTxt
},
"image": {
"url": gif
}

View file

@ -1,13 +1,16 @@
module.exports = {
name: "stop",
description: "Stops the bot",
async execute(client, message, _, footer) {
async execute(client, message, _, footerTxt) {
if (message.author.id == 309427567004483586 || message.author.id == 475558313376088064) {
await message.channel.send({embed: {
"title": "<a:AnitroxWorking:697147309531594843> **Shutting Down...**",
"description": "See you next time!",
"color": 9442302,
"footer": footer
"footer": {
"icon_url": message.author.displayAvatarURL(),
"text": footerTxt
},
}});
client.destroy();
} else {
@ -15,7 +18,10 @@ module.exports = {
"title": ":AnitroxDenied: Access Denied",
"description": "You need to be the bot owner to execute this command!",
"color": 13632027,
"footer": footer
"footer": {
"icon_url": message.author.displayAvatarURL(),
"text": footerTxt
},
}});
}
}

View file

@ -2,13 +2,15 @@ module.exports = {
name: "uinfo",
description: "Gets info about an user, such as ID, Discord Join date and more",
syntax: "<User>",
async execute(client, message, args, footer) {
console.log(args[0])
async execute(client, message, args, footerTxt) {
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": footer,
"footer": {
"icon_url": message.author.displayAvatarURL(),
"text": footerTxt
},
"thumbnail": {
"url": user.displayAvatarURL()
},

View file

@ -4,11 +4,6 @@ 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();
@ -20,6 +15,21 @@ for (const file of commandFiles) {
client.commands.set(command.name, command);
}
client.generateErrorMessage = (errorMsg, messageAuthorURL) => ({embed: {
"title": "<:AnitroxError:809651936563429416> Error",
"color": 13632027,
"footer": {
"icon_url": messageAuthorURL,
"text": footerTxt
},
"fields": [
{
"name": "Well that happened...",
"value": errorMsg
}
]
}})
client.on("error", (e) => console.log("[ERROR]" + error(e)));
client.on("warn", (e) => ("[WARN]" + warn(e)));
client.once('ready', () => {
@ -51,15 +61,18 @@ client.on('message', async (message) => {
if (!client.commands.has(command)) return;
try {
await client.commands.get(command).execute(client, message, args, embedFooter);
await client.commands.get(command).execute(client, message, args, footerTxt);
} catch (error) {
console.stack;
message.channel.send(new Discord.MessageEmbed({
message.channel.send({embed: {
"title": "<:AnitroxError:809651936563429416> **Something went wrong!**",
"description": error.stack,
"color": 13632027,
"footer": footer
}));
"footer": {
"icon_url": message.author.displayAvatarURL(),
"text": footerTxt
},
}});
}
});