Quick and dirty update to discord.js v13

This commit is contained in:
Nathaniel Mason 2022-04-21 17:29:04 +01:00
parent 05ed4d9c5c
commit 2189417343
28 changed files with 63 additions and 59 deletions

View File

@ -12,7 +12,7 @@ module.exports = {
if (!question) { if (!question) {
await message.channel.send(client.generateErrorMessage("You need to ask a question!", message.author.displayAvatarURL)); await message.channel.send(client.generateErrorMessage("You need to ask a question!", message.author.displayAvatarURL));
} else { } else {
await message.channel.send({embed: { await message.channel.send({embeds: [{
"title": ":8ball: 8Ball", "title": ":8ball: 8Ball",
"description": `Your amazing question: **${question}**`, "description": `Your amazing question: **${question}**`,
"color": 9442302, "color": 9442302,
@ -26,7 +26,7 @@ module.exports = {
"value": `${answer}` "value": `${answer}`
} }
] ]
}}); }]});
} }
} }
} }

View File

@ -6,7 +6,7 @@ module.exports = {
async execute(client, message, args, config) { async execute(client, message, args, config) {
const user = message.mentions.users.first() || client.users.cache.get(args[0]) || message.author; const user = message.mentions.users.first() || client.users.cache.get(args[0]) || message.author;
await message.channel.send({embed: { await message.channel.send({embeds: [{
"title": `:frame_photo: ${user.username}'s Beautiful Avatar!`, "title": `:frame_photo: ${user.username}'s Beautiful Avatar!`,
"color": 9442302, "color": 9442302,
"footer": { "footer": {
@ -16,6 +16,6 @@ module.exports = {
"image": { "image": {
"url": user.displayAvatarURL() "url": user.displayAvatarURL()
} }
}}); }]});
} }
} }

View File

@ -9,7 +9,7 @@ module.exports = {
if(!taggedUser) { if(!taggedUser) {
await message.channel.send(client.generateErrorMessage("You need to @mention a user!", message.author.displayAvatarURL())); await message.channel.send(client.generateErrorMessage("You need to @mention a user!", message.author.displayAvatarURL()));
} else { } else {
await message.channel.send({embed: { await message.channel.send({embeds: [{
"title": "<a:SylvBonk:801185845847130113> Bonk", "title": "<a:SylvBonk:801185845847130113> Bonk",
"description": `${taggedUser} You have been bonked by ${message.author}!`, "description": `${taggedUser} You have been bonked by ${message.author}!`,
"color": 9442302, "color": 9442302,
@ -20,7 +20,7 @@ module.exports = {
"image": { "image": {
"url": "https://cdn.discordapp.com/attachments/793537380330111028/801194481549312060/HappyBONK.gif" "url": "https://cdn.discordapp.com/attachments/793537380330111028/801194481549312060/HappyBONK.gif"
} }
}}); }]});
} }
} }
} }

View File

@ -9,7 +9,7 @@ module.exports = {
if(!taggedUser) { if(!taggedUser) {
await message.channel.send("*slams cheese on desk*\n**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 { } else {
await message.channel.send({embed: { await message.channel.send({embeds: [{
"title": ":cheese: Cheesed", "title": ":cheese: Cheesed",
"description": `${taggedUser} You have been cheesed by ${message.author}!`, "description": `${taggedUser} You have been cheesed by ${message.author}!`,
"color": 16312092, "color": 16312092,
@ -20,7 +20,7 @@ module.exports = {
"image": { "image": {
"url": "https://cdn.discordapp.com/attachments/803658122299572255/812867714368536636/R06325af354168febcafd96b8328b7590.png" "url": "https://cdn.discordapp.com/attachments/803658122299572255/812867714368536636/R06325af354168febcafd96b8328b7590.png"
} }
}}); }]});
} }
} }
} }

View File

@ -12,7 +12,7 @@ module.exports = {
await message.channel.send(client.generateErrorMessage("You need to provide some input!", message.author.displayAvatarURL())); await message.channel.send(client.generateErrorMessage("You need to provide some input!", message.author.displayAvatarURL()));
} else { } else {
const answer = options[Math.floor(Math.random() * options.length)]; const answer = options[Math.floor(Math.random() * options.length)];
await message.channel.send({embed: { await message.channel.send({embeds: [{
"title": "I have made my decision:", "title": "I have made my decision:",
"description": answer, "description": answer,
"color": 8311585, "color": 8311585,
@ -20,7 +20,7 @@ module.exports = {
"icon_url": message.author.displayAvatarURL(), "icon_url": message.author.displayAvatarURL(),
"text": config.footerTxt "text": config.footerTxt
}, },
}}); }]});
} }
} }
} }

View File

@ -18,7 +18,7 @@ module.exports = {
if(!taggedUser) { if(!taggedUser) {
await message.channel.send(client.generateErrorMessage("You need to @mention a user!", message.author.displayAvatarURL())); await message.channel.send(client.generateErrorMessage("You need to @mention a user!", message.author.displayAvatarURL()));
} else { } else {
await message.channel.send({embed: { await message.channel.send({embeds: [{
"title": ":heart: Cuddle", "title": ":heart: Cuddle",
"description": `${taggedUser} You have been cuddled by ${message.author}!`, "description": `${taggedUser} You have been cuddled by ${message.author}!`,
"color": 9442302, "color": 9442302,
@ -29,7 +29,7 @@ module.exports = {
"image": { "image": {
"url": gif "url": gif
} }
}}); }]});
} }
} }
} }

View File

@ -12,7 +12,7 @@ module.exports = {
const evaled = inspect(eval(code)); const evaled = inspect(eval(code));
await message.channel.send(evaled, {code:"xl"}); await message.channel.send(evaled, {code:"xl"});
} catch (error) { } catch (error) {
await message.channel.send({embed: { await message.channel.send({embeds: [{
"title": "<:AnitroxError:809651936563429416> **Something went wrong! **", "title": "<:AnitroxError:809651936563429416> **Something went wrong! **",
"color": 13632027, "color": 13632027,
"footer": { "footer": {
@ -29,7 +29,7 @@ module.exports = {
"value": error.message "value": error.message
} }
] ]
}}); }]});
} }
}; };
} }

View File

@ -5,7 +5,7 @@ module.exports = {
syntax: '<Command>', syntax: '<Command>',
async execute(_0, message, _1, config) { async execute(_0, message, _1, config) {
await message.channel.send({embed: { await message.channel.send({embeds: [{
"title": "HELP! SEYMOUR! THE BOT IS ON FIRE!", "title": "HELP! SEYMOUR! THE BOT IS ON FIRE!",
"description": "Get help on anything from commands, to what the bot does! just not your homework..", "description": "Get help on anything from commands, to what the bot does! just not your homework..",
"color": 9442302, "color": 9442302,
@ -23,6 +23,6 @@ module.exports = {
"value": "Join the [support server!](https://discord.gg/grebRGsBZ3)" "value": "Join the [support server!](https://discord.gg/grebRGsBZ3)"
} }
] ]
}}); }]});
} }
} }

View File

@ -18,7 +18,7 @@ module.exports = {
await message.channel.send(client.generateErrorMessage("You need to @mention a user!", message.author.displayAvatarURL())); await message.channel.send(client.generateErrorMessage("You need to @mention a user!", message.author.displayAvatarURL()));
} else { } else {
const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)]; const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)];
await message.channel.send({embed: { await message.channel.send({embeds: [{
"title": "<a:ABlobCatHuggle:801232248035999784> Hug", "title": "<a:ABlobCatHuggle:801232248035999784> Hug",
"description": `${taggedUser} You have been hugged by ${message.author}!`, "description": `${taggedUser} You have been hugged by ${message.author}!`,
"color": 8311585, "color": 8311585,
@ -29,7 +29,7 @@ module.exports = {
"image": { "image": {
"url": gif "url": gif
} }
}}); }]});
} }
} }
} }

View File

@ -24,7 +24,7 @@ module.exports = {
const osu = require('node-os-utils'); const osu = require('node-os-utils');
const cpu = osu.cpu; const cpu = osu.cpu;
await message.channel.send({embed: { await message.channel.send({embeds: [{
"title": "<:AnitroxInfo:809651936831733791> Information about Anitrox", "title": "<:AnitroxInfo:809651936831733791> Information about Anitrox",
"description": "Everything you've ever wanted to know about your favorite bot, Anitrox!", "description": "Everything you've ever wanted to know about your favorite bot, Anitrox!",
"color": 9442302, "color": 9442302,
@ -102,6 +102,6 @@ module.exports = {
} }
] ]
}}); }]});
} }
}; };

View File

@ -5,7 +5,7 @@ module.exports = {
syntax: [], syntax: [],
async execute(_0, message, _1, config) { async execute(_0, message, _1, config) {
await message.channel.send({embed: { await message.channel.send({embeds: [{
"title": "Add Anitrox to your Server!", "title": "Add Anitrox to your Server!",
"description": "Weather you want stable, or that squeaky clean fresh PTB build, we gotchu.", "description": "Weather you want stable, or that squeaky clean fresh PTB build, we gotchu.",
"color": 9442302, "color": 9442302,
@ -30,6 +30,6 @@ module.exports = {
"value": "Come join the Anitrox Support Server, for support and much more!\n [Anitrox Support Server](https://discord.gg/grebRGsBZ3)" "value": "Come join the Anitrox Support Server, for support and much more!\n [Anitrox Support Server](https://discord.gg/grebRGsBZ3)"
} }
] ]
}}); }]});
}, },
}; };

View File

@ -18,7 +18,7 @@ module.exports = {
await message.channel.send(client.generateErrorMessage("You need to @mention a user!", message.author.displayAvatarURL())); await message.channel.send(client.generateErrorMessage("You need to @mention a user!", message.author.displayAvatarURL()));
} else { } else {
const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)]; const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)];
await message.channel.send({embed: { await message.channel.send({embeds: [{
"title": ":heart: Kiss", "title": ":heart: Kiss",
"description": `${taggedUser} You have been kissed by ${message.author}!`, "description": `${taggedUser} You have been kissed by ${message.author}!`,
"color": 9442302, "color": 9442302,
@ -29,7 +29,7 @@ module.exports = {
"image": { "image": {
"url": gif "url": gif
} }
}}); }]});
} }
} }
} }

View File

@ -28,7 +28,7 @@ module.exports = {
await message.channel.send(client.generateErrorMessage("You need to @mention a user!", message.author.displayAvatarURL())); await message.channel.send(client.generateErrorMessage("You need to @mention a user!", message.author.displayAvatarURL()));
} else { } else {
const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)]; const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)];
await message.channel.send({embed: { await message.channel.send({embeds: [{
"title": ":heart: <:lesbian:803831629428686849> Kiss", "title": ":heart: <:lesbian:803831629428686849> Kiss",
"description": `${taggedUser} You have been kissed by ${message.author}!`, "description": `${taggedUser} You have been kissed by ${message.author}!`,
"color": 8311585, "color": 8311585,
@ -39,7 +39,7 @@ module.exports = {
"image": { "image": {
"url": gif "url": gif
} }
}}); }]});
} }
} }
} }

View File

@ -17,7 +17,7 @@ module.exports = {
await message.channel.send(client.generateErrorMessage("You need to @mention a user!", message.author.displayAvatarURL())); await message.channel.send(client.generateErrorMessage("You need to @mention a user!", message.author.displayAvatarURL()));
} else { } else {
const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)]; const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)];
await message.channel.send({embed: { await message.channel.send({embeds: [{
"title": "<a:LeafeonLick:806396195089154058> Lick", "title": "<a:LeafeonLick:806396195089154058> Lick",
"description": `${taggedUser} You have been licked by ${message.author}!`, "description": `${taggedUser} You have been licked by ${message.author}!`,
"color": 8311585, "color": 8311585,
@ -28,7 +28,7 @@ module.exports = {
"image": { "image": {
"url": "https://cdn.discordapp.com/attachments/803658122299572255/805314244123951114/cef569820773b0f5d54ee34cfa18e1f8.gif" "url": "https://cdn.discordapp.com/attachments/803658122299572255/805314244123951114/cef569820773b0f5d54ee34cfa18e1f8.gif"
} }
}}); }]});
} }
} }
} }

View File

@ -17,7 +17,7 @@ module.exports = {
await message.channel.send(client.generateErrorMessage("You need to @mention a user!", message.author.displayAvatarURL())); await message.channel.send(client.generateErrorMessage("You need to @mention a user!", message.author.displayAvatarURL()));
} else { } else {
const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)]; const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)];
await message.channel.send({embed: { await message.channel.send({embeds: [{
"title": "<:BlobNomBlob:801241117919805510> Nom", "title": "<:BlobNomBlob:801241117919805510> Nom",
"description": `${taggedUser} You have been nommed by ${message.author}!`, "description": `${taggedUser} You have been nommed by ${message.author}!`,
"color": 8311585, "color": 8311585,
@ -28,7 +28,7 @@ module.exports = {
"image": { "image": {
"url": gif "url": gif
} }
}}); }]});
} }
} }
} }

View File

@ -4,7 +4,7 @@ module.exports = {
description: 'Attributions to open source components used by Anitrox', description: 'Attributions to open source components used by Anitrox',
async execute(_0, message, _1, config){ async execute(_0, message, _1, config){
await message.channel.send({embed: { await message.channel.send({embeds: [{
"title": "Component Attribution", "title": "Component Attribution",
"description": "Some parts of Anitrox are using open source code, and their attributions are avaliable here!", "description": "Some parts of Anitrox are using open source code, and their attributions are avaliable here!",
"color": 52508, "color": 52508,
@ -29,6 +29,6 @@ module.exports = {
"value": "Using and supporting the Anitrox Project, thank you! ❤" "value": "Using and supporting the Anitrox Project, thank you! ❤"
} }
] ]
}}); }]});
} }
} }

View File

@ -16,7 +16,7 @@ module.exports = {
await message.channel.send(client.generateErrorMessage("You need to @mention a user!", message.author.displayAvatarURL())); await message.channel.send(client.generateErrorMessage("You need to @mention a user!", message.author.displayAvatarURL()));
} else { } else {
const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)]; const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)];
await message.channel.send({embed: { await message.channel.send({embeds: [{
"title": "<:pats:801238281286713355> Pat", "title": "<:pats:801238281286713355> Pat",
"description": `${taggedUser} You have been patted by ${message.author}!`, "description": `${taggedUser} You have been patted by ${message.author}!`,
"color": 8311585, "color": 8311585,
@ -27,7 +27,7 @@ module.exports = {
"image": { "image": {
"url": gif "url": gif
} }
}}); }]});
} }
} }
} }

View File

@ -7,7 +7,7 @@ module.exports = {
const index = Math.floor(Math.random() * config.locations.length); const index = Math.floor(Math.random() * config.locations.length);
const location = config.locations[index] const location = config.locations[index]
await message.channel.send({embed:{ await message.channel.send({embeds:[{
"title": ":ping_pong: Ping", "title": ":ping_pong: Ping",
"description": `**Pong!** We pinged **${location}** and got ${client.ws.ping} ms.`, "description": `**Pong!** We pinged **${location}** and got ${client.ws.ping} ms.`,
"color": 9442302, "color": 9442302,
@ -15,6 +15,6 @@ module.exports = {
"icon_url": message.author.displayAvatarURL(), "icon_url": message.author.displayAvatarURL(),
"text": config.footerTxt "text": config.footerTxt
} }
}}); }]});
} }
}; };

View File

@ -16,7 +16,7 @@ module.exports = {
await message.channel.send(client.generateErrorMessage("You need to @mention a user!", message.author.displayAvatarURL())); await message.channel.send(client.generateErrorMessage("You need to @mention a user!", message.author.displayAvatarURL()));
} else { } else {
const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)]; const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)];
await message.channel.send({embed: { await message.channel.send({embeds: [{
"title": "👉 Poke!", "title": "👉 Poke!",
"description": `${taggedUser} You have been poked by ${message.author}!`, "description": `${taggedUser} You have been poked by ${message.author}!`,
"color": 8311585, "color": 8311585,
@ -27,7 +27,7 @@ module.exports = {
"image": { "image": {
"url": gif "url": gif
} }
}}); }]});
} }
} }
} }

View File

@ -31,7 +31,7 @@ module.exports = {
}); });
} else { } else {
message.channel.send({embed: { message.channel.send({embeds: [{
"title": "<:AnitroxDenied:809651936642203668> **403 Forbidden**", "title": "<:AnitroxDenied:809651936642203668> **403 Forbidden**",
"color": 13632027, "color": 13632027,
"footer": { "footer": {
@ -44,7 +44,7 @@ module.exports = {
"value": "You don't have the appropriate permissions to run this command!" "value": "You don't have the appropriate permissions to run this command!"
} }
] ]
}}); }]});
} }
} }
}; };

View File

@ -8,7 +8,7 @@ module.exports = {
const newnick = args.slice(0).join(" ") const newnick = args.slice(0).join(" ")
try { try {
await message.member.setNickname(newnick, "Nickname change requested by the server member. If you don't want users to be able to change their nickname disable 'CHANGE_NICKNAME' via Change Nickname in Roles.") await message.member.setNickname(newnick, "Nickname change requested by the server member. If you don't want users to be able to change their nickname disable 'CHANGE_NICKNAME' via Change Nickname in Roles.")
await message.channel.send({embed: { await message.channel.send({embeds: [{
"title": "<:AnitroxSuccess:809651936819019796> Nickname Changed", "title": "<:AnitroxSuccess:809651936819019796> Nickname Changed",
"color": 9442302, "color": 9442302,
"footer": { "footer": {
@ -26,7 +26,7 @@ module.exports = {
"inline": true "inline": true
} }
] ]
}}); }]});
} catch (error) { } catch (error) {
await message.channel.send(client.generateErrorMessage("Failed to set user nickname. Does the bot have the correct permissions?", message.author.displayAvatarURL())); await message.channel.send(client.generateErrorMessage("Failed to set user nickname. Does the bot have the correct permissions?", message.author.displayAvatarURL()));
}; };

View File

@ -9,7 +9,7 @@ module.exports = {
if(!taggedUser) { if(!taggedUser) {
await message.channel.send(client.generateErrorMessage("You need to @mention a user!", message.author.displayAvatarURL())); await message.channel.send(client.generateErrorMessage("You need to @mention a user!", message.author.displayAvatarURL()));
} else { } else {
await message.channel.send({embed: { await message.channel.send({embeds: [{
"title": ":anger: Slap", "title": ":anger: Slap",
"description": `${taggedUser} You have been slapped by ${message.author}!`, "description": `${taggedUser} You have been slapped by ${message.author}!`,
"color": 9442302, "color": 9442302,
@ -20,7 +20,7 @@ module.exports = {
"image": { "image": {
"url": "https://media1.tenor.com/images/b6d8a83eb652a30b95e87cf96a21e007/tenor.gif?itemid=10426943" "url": "https://media1.tenor.com/images/b6d8a83eb652a30b95e87cf96a21e007/tenor.gif?itemid=10426943"
} }
}}); }]});
} }
} }
} }

View File

@ -17,7 +17,7 @@ module.exports = {
await message.channel.send(client.generateErrorMessage("You need to @mention a user!", message.author.displayAvatarURL())); await message.channel.send(client.generateErrorMessage("You need to @mention a user!", message.author.displayAvatarURL()));
} else { } else {
const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)]; const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)];
await message.channel.send({embed: { await message.channel.send({embeds: [{
"title": "<:BlobSnuggleCat:806759753450782731> Snuggle", "title": "<:BlobSnuggleCat:806759753450782731> Snuggle",
"description": `${taggedUser} You have been snuggled by ${message.author}!`, "description": `${taggedUser} You have been snuggled by ${message.author}!`,
"color": 9442302, "color": 9442302,
@ -28,7 +28,7 @@ module.exports = {
"image": { "image": {
"url": gif "url": gif
} }
}}); }]});
} }
} }
} }

View File

@ -5,7 +5,7 @@ module.exports = {
async execute(_0, message, _1, config) { async execute(_0, message, _1, config) {
if (message.author.id == config.ownerID) { if (message.author.id == config.ownerID) {
await message.channel.send({embed: { await message.channel.send({embeds: [{
"title": "<a:AnitroxWorking:697147309531594843> **Shutting Down...**", "title": "<a:AnitroxWorking:697147309531594843> **Shutting Down...**",
"description": "See you next time!", "description": "See you next time!",
"color": 9442302, "color": 9442302,
@ -13,11 +13,11 @@ module.exports = {
"icon_url": message.author.displayAvatarURL(), "icon_url": message.author.displayAvatarURL(),
"text": config.footerTxt "text": config.footerTxt
}, },
}}); }]});
console.log("The bot is shutting down! Bye bye!") console.log("The bot is shutting down! Bye bye!")
process.exit(); process.exit();
} else { } else {
await message.channel.send({embed: { await message.channel.send({embeds: [{
"title": "<:AnitroxDenied:809651936642203668> 403 Forbidden", "title": "<:AnitroxDenied:809651936642203668> 403 Forbidden",
"description": "You need to be the bot owner to execute this command!", "description": "You need to be the bot owner to execute this command!",
"color": 13632027, "color": 13632027,
@ -25,7 +25,7 @@ module.exports = {
"icon_url": message.author.displayAvatarURL(), "icon_url": message.author.displayAvatarURL(),
"text": config.footerTxt "text": config.footerTxt
}, },
}}); }]});
} }
} }
} }

View File

@ -7,7 +7,7 @@ module.exports = {
async execute(client, message, args, config) { async execute(client, message, args, config) {
const user = message.mentions.users.first() || client.users.cache.get(args[0]) || message.author const user = message.mentions.users.first() || client.users.cache.get(args[0]) || message.author
await message.channel.send({embed: { await message.channel.send({embeds: [{
"title": `Everything you've ever wanted to know about ${user.username}!`, "title": `Everything you've ever wanted to know about ${user.username}!`,
"color": 9442302, "color": 9442302,
"footer": { "footer": {
@ -52,6 +52,6 @@ module.exports = {
inline: true inline: true
}, },
] ]
}}); }]});
} }
} }

View File

@ -53,5 +53,9 @@
"Go for it! :smile:", "Go for it! :smile:",
"Good idea!", "Good idea!",
"Sure" "Sure"
],
"intents": [
"GUILDS",
"GUILD_MESSAGES"
] ]
} }

View File

@ -4,7 +4,7 @@
"description": "Discord Bot Based on Discord.JS", "description": "Discord Bot Based on Discord.JS",
"main": "start.js", "main": "start.js",
"dependencies": { "dependencies": {
"discord.js": "^12.5.1", "discord.js": "^13.6.0",
"node-os-utils": "^1.3.2", "node-os-utils": "^1.3.2",
"require-all": "^3.0.0" "require-all": "^3.0.0"
}, },

View File

@ -4,7 +4,7 @@ const fs = require('fs');
const Discord = require('discord.js'); const Discord = require('discord.js');
const config = require('./config.json'); const config = require('./config.json');
console.log('Starting!') console.log('Starting!')
const client = new Discord.Client(); const client = new Discord.Client({ intents: config.intents.map(intent => eval(`Discord.Intents.FLAGS.${intent}`))});
client.commands = new Discord.Collection(); client.commands = new Discord.Collection();
const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js')); const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js'));
@ -14,7 +14,7 @@ for (const file of commandFiles) {
client.commands.set(command.name, command); client.commands.set(command.name, command);
} }
client.generateErrorMessage = (errorMsg, messageAuthorURL) => ({embed: { client.generateErrorMessage = (errorMsg, messageAuthorURL) => ({embeds: [{
"title": "<:AnitroxError:809651936563429416> Error", "title": "<:AnitroxError:809651936563429416> Error",
"color": 13632027, "color": 13632027,
"footer": { "footer": {
@ -27,7 +27,7 @@ client.generateErrorMessage = (errorMsg, messageAuthorURL) => ({embed: {
"value": errorMsg "value": errorMsg
} }
] ]
}}) }]})
client.on("error", (e) => console.log(`[ERROR] ${error(e)}`)); client.on("error", (e) => console.log(`[ERROR] ${error(e)}`));
client.on("warn", (e) => (`[WARN] ${warn(e)}`)); client.on("warn", (e) => (`[WARN] ${warn(e)}`));
@ -51,7 +51,7 @@ client.once('ready', () => {
// Begin Command Handler // Begin Command Handler
client.on('message', async (message) => { client.on('messageCreate', async (message) => {
if (!message.content.startsWith(config.prefix) || message.author.bot) return; if (!message.content.startsWith(config.prefix) || message.author.bot) return;
@ -64,7 +64,7 @@ client.on('message', async (message) => {
await client.commands.get(command).execute(client, message, args, config); await client.commands.get(command).execute(client, message, args, config);
} catch (error) { } catch (error) {
console.stack; console.stack;
message.channel.send({embed: { message.channel.send({embeds: [{
"title": "<:AnitroxError:809651936563429416> **Something went wrong!**", "title": "<:AnitroxError:809651936563429416> **Something went wrong!**",
"description": error.stack, "description": error.stack,
"color": 13632027, "color": 13632027,
@ -72,7 +72,7 @@ client.on('message', async (message) => {
"icon_url": message.author.displayAvatarURL(), "icon_url": message.author.displayAvatarURL(),
"text": config.footerTxt "text": config.footerTxt
}, },
}}); }]});
} }
}); });