From 28b73e3a8f7d96ddaea147ba236b98c4df70d4f3 Mon Sep 17 00:00:00 2001 From: Braeden Sowinski Date: Sat, 27 Aug 2022 20:14:21 -0700 Subject: [PATCH] better error handling --- commands/311.js | 2 +- commands/911.js | 2 +- commands/bank.js | 80 +++++++++++++++++----------------- commands/fine.js | 12 +++--- commands/inventory.js | 40 ++++++++--------- commands/me.js | 2 +- commands/money.js | 12 +++--- commands/reset.js | 8 ++-- commands/search.js | 8 ++-- commands/settings.js | 96 ++++++++++++++++++++--------------------- commands/tweet.js | 2 +- commands/wallet.js | 12 +++--- commands/work.js | 24 +++++------ structures/QuarksBot.js | 17 +++++--- 14 files changed, 160 insertions(+), 157 deletions(-) diff --git a/commands/311.js b/commands/311.js index d5ed157..470aa99 100644 --- a/commands/311.js +++ b/commands/311.js @@ -152,7 +152,7 @@ module.exports = { const channel = interaction.guild.channels.cache.find(channel => channel.id === GuildDB.dispatchChannel); if (!channel) { const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nThe channel may have been deleted\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:** ${err}\nThe channel may have been deleted\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); diff --git a/commands/911.js b/commands/911.js index a2c32bd..0facd57 100644 --- a/commands/911.js +++ b/commands/911.js @@ -152,7 +152,7 @@ module.exports = { const channel = interaction.guild.channels.cache.find(channel => channel.id === GuildDB.dispatchChannel); if (!channel) { const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nThe channel may have been deleted\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:** ${err}\nThe channel may have been deleted\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); diff --git a/commands/bank.js b/commands/bank.js index 222a290..0c93993 100644 --- a/commands/bank.js +++ b/commands/bank.js @@ -134,9 +134,9 @@ module.exports = { newBank.save() .catch(err => { if (err) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); @@ -148,9 +148,9 @@ module.exports = { if (!client.exists(banking.guilds[GuildDB.serverID])) { const success = addBank(banking.guilds, GuildDB.serverID, interaction.member.user.id, client, GuildDB.startingBalance); if (!success) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); @@ -166,9 +166,9 @@ module.exports = { newInventory.save() .catch(err => { if (err) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); @@ -179,9 +179,9 @@ module.exports = { if (!client.exists(inventory.guilds[GuildDB.serverID])) { const success = addInventory(inventory.guilds, GuildDB.serverID, interaction.member.user.id, client); if (!success) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); @@ -202,9 +202,9 @@ module.exports = { client.dbo.collection("banks").updateOne({"account.userID":interaction.member.user.id},{$set:{[`banking.guilds.${GuildDB.serverID}.account.balance`]:newBalance,[`banking.guilds.${GuildDB.serverID}.account.cash`]:newCash}}, function(err, res) { if (err) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); @@ -213,9 +213,9 @@ module.exports = { client.dbo.collection("inventories").updateOne({"inventory.userID":interaction.member.user.id, [`inventory.guilds.${GuildDB.serverID}.items.type`]:"wallet"}, {$set:{[`inventory.guilds.${GuildDB.serverID}.items.$.cash`]:newCash}}, function(err, res) { if (err) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); @@ -243,9 +243,9 @@ module.exports = { client.dbo.collection("banks").updateOne({"account.userID":interaction.member.user.id},{$set:{[`banking.guilds.${GuildDB.serverID}.account.balance`]:newBalance,[`banking.guilds.${GuildDB.serverID}.account.cash`]:newCash}}, function(err, res) { if (err) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); @@ -254,9 +254,9 @@ module.exports = { client.dbo.collection("inventories").updateOne({"inventory.userID":interaction.member.user.id, [`inventory.guilds.${GuildDB.serverID}.items.type`]:"wallet"}, {$set:{[`inventory.guilds.${GuildDB.serverID}.items.$.cash`]:newCash}}, function(err, res) { if (err) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); @@ -299,9 +299,9 @@ module.exports = { newBank.save() .catch(err => { if (err) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); @@ -313,9 +313,9 @@ module.exports = { if (!client.exists(targetUserBanking.guilds[GuildDB.serverID])) { const success = addBank(targetUserBanking.guilds, GuildDB.serverID, targetUserID, client, GuildDB.startingBalance); if (!success) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); @@ -357,9 +357,9 @@ module.exports = { client.dbo.collection("banks").updateOne({"account.userID":interaction.member.user.id},{$set:{[`banking.guilds.${GuildDB.serverID}.account.cash`]:newCash}}, function(err, res) { if (err) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); @@ -369,9 +369,9 @@ module.exports = { client.dbo.collection("inventories").updateOne({"inventory.userID":interaction.member.user.id, [`inventory.guilds.${GuildDB.serverID}.items.type`]:"wallet"}, {$set:{[`inventory.guilds.${GuildDB.serverID}.items.$.cash`]:newCash}}, function(err, res) { if (err) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); @@ -389,9 +389,9 @@ module.exports = { newInventory.save() .catch(err => { if (err) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); @@ -402,9 +402,9 @@ module.exports = { if (!client.exists(targetUserInventory.guilds[GuildDB.serverID])) { const success = addInventory(targetUserInventory.guilds, GuildDB.serverID, targetUserID, client); if (!success) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); @@ -415,9 +415,9 @@ module.exports = { client.dbo.collection("inventories").updateOne({"inventory.userID":targetUserID, [`inventory.guilds.${GuildDB.serverID}.items.type`]:"wallet"}, {$set:{[`inventory.guilds.${GuildDB.serverID}.items.$.cash`]:newTargetCash}}, function(err, res) { if (err) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); @@ -438,9 +438,9 @@ module.exports = { client.dbo.collection("banks").insertOne(targetUserBanking, function(err, res) { if (err) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); @@ -451,9 +451,9 @@ module.exports = { client.dbo.collection("banks").updateOne({"account.userID": targetUserID}, {$set: {[`banking.guilds.${GuildDB.serverID}.account.cash`]: newTargetCash}}, function(err, res) { if (err) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); @@ -483,9 +483,9 @@ module.exports = { client.dbo.collection("banks").updateOne({"account.userID":interaction.member.user.id},{$set:{[`banking.guilds.${GuildDB.serverID}.account.balance`]:newBalance}}, function(err, res) { if (err) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); @@ -506,9 +506,9 @@ module.exports = { client.dbo.collection("banks").insertOne(targetUserBanking, function(err, res) { if (err) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); @@ -519,9 +519,9 @@ module.exports = { client.dbo.collection("banks").updateOne({"account.userID":targetUserID},{$set:{[`banking.guilds.${GuildDB.serverID}.account.balance`]:newTargetBalance}}, function(err, res) { if (err) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); diff --git a/commands/fine.js b/commands/fine.js index e8c3997..ab27c96 100644 --- a/commands/fine.js +++ b/commands/fine.js @@ -78,9 +78,9 @@ module.exports = { newBank.save() .catch(err => { if (err) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); @@ -92,9 +92,9 @@ module.exports = { if (!client.exists(banking.guilds[GuildDB.serverID])) { const success = addBank(banking.guilds, GuildDB.serverID, targetUserID, client, GuildDB.startingBalance); if (!success) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); @@ -105,9 +105,9 @@ module.exports = { client.dbo.collection("banks").updateOne({"account.userID":targetUserID},{$set:{[`banking.guilds.${GuildDB.serverID}.account.balance`]:newTargetBalance}}, function(err, res) { if (err) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); diff --git a/commands/inventory.js b/commands/inventory.js index f70cd72..d414cb5 100644 --- a/commands/inventory.js +++ b/commands/inventory.js @@ -181,9 +181,9 @@ module.exports = { newInventory.save() .catch(err => { if (err) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); @@ -194,9 +194,9 @@ module.exports = { if (!client.exists(inventory.guilds[GuildDB.serverID])) { const success = addInventory(inventory.guilds, GuildDB.serverID, interaction.member.user.id, client); if (!success) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); @@ -326,9 +326,9 @@ module.exports = { client.dbo.collection('inventories').updateOne({'inventory.userID': interaction.member.user.id}, {$push: {[`inventory.guilds.${GuildDB.serverID}.items`]: firearm}}, function(err, res) { if (err) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); @@ -353,9 +353,9 @@ module.exports = { client.dbo.collection('inventories').updateOne({'inventory.userID': interaction.member.user.id}, {$push: {[`inventory.guilds.${GuildDB.serverID}.items`]: item}}, function(err, res) { if (err) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); @@ -392,9 +392,9 @@ module.exports = { client.dbo.collection('inventories').updateOne({'inventory.userID': interaction.member.user.id}, {$pull: {[`inventory.guilds.${GuildDB.serverID}.items`]: item}}, function(err, res) { if (err) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); @@ -468,9 +468,9 @@ module.exports = { newInventory.save() .catch(err => { if (err) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return MenuInteraction.update({ embeds: [embed], components: [] }); @@ -480,9 +480,9 @@ module.exports = { if (!client.exists(targetUserInventory.guilds[GuildDB.serverID])) { const success = addInventory(inventory.guilds, GuildDB.serverID, targetUserID, client); if (!success) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return MenuInteraction.update({ embeds: [embed], components: [] }); @@ -491,9 +491,9 @@ module.exports = { client.dbo.collection('inventories').updateOne({'inventory.userID': interaction.member.user.id}, {$pull: {[`inventory.guilds.${GuildDB.serverID}.items`]: item}}, function(err, res) { if (err) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return MenuInteraction.update({ embeds: [embed], components: [] }); @@ -501,9 +501,9 @@ module.exports = { }); client.dbo.collection('inventories').updateOne({'inventory.userID': targetUserID}, {$push: {[`inventory.guilds.${GuildDB.serverID}.items`]: item}}, function(err, res) { if (err) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return MenuInteraction.update({ embeds: [embed], components: [] }); @@ -555,9 +555,9 @@ module.exports = { const tempWallet = inventory.guilds[GuildDB.serverID].items[0]; client.dbo.collection("inventories").updateOne({"inventory.userID":inventory.userID},{$set:{[`inventory.guilds.${GuildDB.serverID}.items`]: [tempWallet]}},function(err, res) { if (err) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); diff --git a/commands/me.js b/commands/me.js index efed3a5..205523b 100644 --- a/commands/me.js +++ b/commands/me.js @@ -41,7 +41,7 @@ module.exports = { const channel = interaction.guild.channels.cache.find(channel => channel.id === GuildDB.actionChannel); if (!channel) { const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nThe channel may have been deleted\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:** ${err}\nThe channel may have been deleted\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); diff --git a/commands/money.js b/commands/money.js index d8e6f4e..c194d1f 100644 --- a/commands/money.js +++ b/commands/money.js @@ -79,9 +79,9 @@ module.exports = { newBank.save() .catch(err => { if (err) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); @@ -93,9 +93,9 @@ module.exports = { if (!client.exists(banking.guilds[GuildDB.serverID])) { const success = addBank(banking.guilds, GuildDB.serverID, targetUserID, client, GuildDB.startingBalance); if (!success) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); @@ -108,9 +108,9 @@ module.exports = { client.dbo.collection("banks").updateOne({"account.userID":targetUserID},{$set:{[`banking.guilds.${GuildDB.serverID}.account.balance`]:newBalance}}, function(err, res) { if (err) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); diff --git a/commands/reset.js b/commands/reset.js index 6f21cf6..58ea940 100644 --- a/commands/reset.js +++ b/commands/reset.js @@ -88,9 +88,9 @@ module.exports = { if (!inventoryReset) { const success = addInventory(inventory.guilds, GuildDB.serverID, targetUserID, client); if (!success) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return ButtonInteraction.update({ embeds: [embed], components: [] }); @@ -100,9 +100,9 @@ module.exports = { if (!bankingReset) { const success = addBank(banking.guilds, GuildDB.serverID, targetUserID, client); if (!success) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return ButtonInteraction.update({ embeds: [embed], components: [] }); diff --git a/commands/search.js b/commands/search.js index 396cf29..87f886d 100644 --- a/commands/search.js +++ b/commands/search.js @@ -68,9 +68,9 @@ module.exports = { newInventory.save() .catch(err => { if (err) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); @@ -81,9 +81,9 @@ module.exports = { if (!client.exists(inventory.guilds[GuildDB.serverID])) { const success = addInventory(inventory.guilds, GuildDB.serverID, targetUserID, client); if (!success) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); diff --git a/commands/settings.js b/commands/settings.js index f12452b..5e30859 100644 --- a/commands/settings.js +++ b/commands/settings.js @@ -368,14 +368,14 @@ module.exports = { let error = false; if (!channel) {error=true;errorEmbed.setDescription(`**Error Notice:** Cannot find that channel.`);} - if (channel.type=="voice") {error=true;errorEmbed.setDescriptions(`**Error Notice:** Cannot add voice channel to allowed channels.`);} + if (channel.type=="voice") {error=true;errorEmbed.setDescription(`**Error Notice:** Cannot add voice channel to allowed channels.`);} if (error) return interaction.send({ embeds: [errorEmbed] }); client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID}, {$push:{"server.allowedChannels": channelid}}, function (err, res) { if (err) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); @@ -427,9 +427,9 @@ module.exports = { action = 'removed'; client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID}, {$pull:{"server.allowedChannels": channelid}}, function (err, res) { if (err) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); @@ -458,9 +458,9 @@ module.exports = { if (channelSetting == channelid) return interaction.send({ embeds: [presetEmbed] }); client.dbo.collection("guilds").updateOne({"server.serverID":interaction.guild.id},{$set:{"server.actionChannel":channelid}},function(err, res) { if (err) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); @@ -505,9 +505,9 @@ module.exports = { action = 'removed'; client.dbo.collection("guilds").updateOne({"server.serverID":ButtonInteraction.guild.id},{$set:{"server.actionChannel": null}},function(err, res) { if (err) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); @@ -536,9 +536,9 @@ module.exports = { if (channelSetting == channelid) return interaction.send({ embeds: [presetEmbed] }); client.dbo.collection("guilds").updateOne({"server.serverID":interaction.guild.id},{$set:{"server.tweetChannel":channelid}},function(err, res) { if (err) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); @@ -583,9 +583,9 @@ module.exports = { action = 'removed'; client.dbo.collection("guilds").updateOne({"server.serverID":ButtonInteraction.guild.id},{$set:{"server.tweetChannel": null}},function(err, res) { if (err) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); @@ -614,9 +614,9 @@ module.exports = { if (channelSetting == channelid) return interaction.send({ embeds: [presetEmbed] }); client.dbo.collection("guilds").updateOne({"server.serverID":interaction.guild.id},{$set:{"server.advertsChannel":channelid}},function(err, res) { if (err) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); @@ -661,9 +661,9 @@ module.exports = { action = 'removed'; client.dbo.collection("guilds").updateOne({"server.serverID":ButtonInteraction.guild.id},{$set:{"server.advertsChannel": null}},function(err, res) { if (err) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); @@ -693,9 +693,9 @@ module.exports = { if (channelSetting == channelid) return interaction.send({ embeds: [presetEmbed] }); client.dbo.collection("guilds").updateOne({"server.serverID":interaction.guild.id},{$set:{"server.dispatchChannel":channelid}},function(err, res) { if (err) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); @@ -740,9 +740,9 @@ module.exports = { action = 'removed'; client.dbo.collection("guilds").updateOne({"server.serverID":ButtonInteraction.guild.id},{$set:{"server.dispatchChannel": null}},function(err, res) { if (err) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); @@ -762,9 +762,9 @@ module.exports = { } else if (args[0].name == 'starting_balance') { client.dbo.collection("guilds").updateOne({"server.serverID": GuildDB.serverID}, {"server.startingBalance":args[0].options[0].value}, function(err, res) { if (err) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); @@ -783,7 +783,7 @@ module.exports = { if (args[0].options[0].options[1].value <= 0) { let embed = new EmbedBuilder() - .setDescriptions('**Error Notice:** Amount cannot be $0 or less than $0.') + .setDescription('**Error Notice:** Amount cannot be $0 or less than $0.') .setColor(client.config.Colors.Red); return interaction.send({ embeds: [embed] }); @@ -798,9 +798,9 @@ module.exports = { client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID}, {$push: {"server.incomeRoles":newIncome}}, function(err, res) { if (err) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); @@ -810,9 +810,9 @@ module.exports = { client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID, "server.incomeRoles.role": roleId}, {$set: {"server.incomeRoles.$.income": args[0].options[0].options[1].value}}, function(err, res) { if (err) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); @@ -868,9 +868,9 @@ module.exports = { action = 'removed'; client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID}, {$pull: {"server.incomeRoles": roleId}}, function(err, res) { if (err) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); @@ -894,9 +894,9 @@ module.exports = { client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID},{$set:{"server.commercialRole": roleId}}, function(err, res) { if (err) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); @@ -942,9 +942,9 @@ module.exports = { action = 'removed'; client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID}, {$set: {"server.commercialRole": null}}, function(err, res) { if (err) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); @@ -968,9 +968,9 @@ module.exports = { client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID},{$set:{"server.officerRole": roleId}}, function(err, res) { if (err) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); @@ -1016,9 +1016,9 @@ module.exports = { action = 'removed'; client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID}, {$set: {"server.officerRole": null}}, function(err, res) { if (err) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); @@ -1042,9 +1042,9 @@ module.exports = { client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID},{$set:{"server.dispatcherRole": roleId}}, function(err, res) { if (err) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); @@ -1090,9 +1090,9 @@ module.exports = { action = 'removed'; client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID}, {$set: {"server.dispatcherRole": null}}, function(err, res) { if (err) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); @@ -1116,9 +1116,9 @@ module.exports = { client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID},{$set:{"server.botAdmin": roleId}}, function(err, res) { if (err) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); @@ -1164,9 +1164,9 @@ module.exports = { action = 'removed'; client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID}, {$set: {"server.botAdmin": null}}, function(err, res) { if (err) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); @@ -1186,9 +1186,9 @@ module.exports = { const setting = args[0].options[0]; client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID}, {$set: {"server.onlyOfficersSearch": setting}}, function(err, res) { if (err) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); diff --git a/commands/tweet.js b/commands/tweet.js index 956ad44..0c998d0 100644 --- a/commands/tweet.js +++ b/commands/tweet.js @@ -46,7 +46,7 @@ module.exports = { const channel = interaction.guild.channels.cache.find(channel => channel.id === GuildDB.tweetChannel); if (!channel) { const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nThe channel may have been deleted\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:** ${err}\nThe channel may have been deleted\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); diff --git a/commands/wallet.js b/commands/wallet.js index 62fc406..a9f7623 100644 --- a/commands/wallet.js +++ b/commands/wallet.js @@ -84,9 +84,9 @@ module.exports = { newInventory.save() .catch(err => { if (err) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); @@ -97,9 +97,9 @@ module.exports = { if (!client.exists(inventory.guilds[GuildDB.serverID])) { const success = addInventory(inventory.guilds, GuildDB.serverID, interaction.member.user.id, client); if (!success) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); @@ -155,9 +155,9 @@ module.exports = { client.dbo.collection("inventories").updateOne(query, update, function (err, res) { if (err) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); diff --git a/commands/work.js b/commands/work.js index f608232..4455776 100644 --- a/commands/work.js +++ b/commands/work.js @@ -51,9 +51,9 @@ module.exports = { newInventory.save() .catch(err => { if (err) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); @@ -64,9 +64,9 @@ module.exports = { if (!client.exists(inventory.guilds[GuildDB.serverID])) { const success = addInventory(inventory.guilds, GuildDB.serverID, interaction.member.user.id, client); if (!success) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); @@ -108,9 +108,9 @@ module.exports = { newBank.save() .catch(err => { if (err) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); @@ -122,9 +122,9 @@ module.exports = { if (!client.exists(banking.guilds[GuildDB.serverID])) { const success = addBank(banking.guilds, GuildDB.serverID, interaction.member.user.id, client, GuildDB.startingBalance); if (!success) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); @@ -142,9 +142,9 @@ module.exports = { client.dbo.collection("banks").updateOne({"account.userID":interaction.member.user.id},{$set:{[`banking.guilds.${GuildDB.serverID}.account.balance`]:newBalance}}, function(err, res) { if (err) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); @@ -153,9 +153,9 @@ module.exports = { client.dbo.collection("inventories").updateOne({"inventory.userID":interaction.member.user.id}, {$set: {[`inventory.guilds.${GuildDB.serverID}.lastWork`]: now}}, function(err, res) { if (err) { - client.log(err); + client.error(err); const embed = new EmbedBuilder() - .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); diff --git a/structures/QuarksBot.js b/structures/QuarksBot.js index 0589d4a..8e88903 100644 --- a/structures/QuarksBot.js +++ b/structures/QuarksBot.js @@ -45,18 +45,21 @@ class QuarksBot extends Client { return await rest.post(Routes.interactionCallback(interaction.id, interaction.token), { body: { type: 4, - // data: typeof message == "string" - // ? { content: message, ...(message.ephemeral && {flags: (1 << 6)}), } - // : message.embeds[0] && message.embeds[0].type === "rich" - // ? { embeds: message.embeds, ...(message.ephemeral && {flags: (1 << 6)}), } - // : { message, ...(message.ephemeral && {flags: (1 << 6)}), }, data: message, } }); }; let cmd = client.commands.get(command); - if ((cmd.name == 'ping' || cmd.name == 'stats') && cmd.SlashCommand && cmd.SlashCommand.run) cmd.SlashCommand.run(this, interaction, args, { GuildDB }, start); - else if (cmd.SlashCommand && cmd.SlashCommand.run) cmd.SlashCommand.run(this, interaction, args, { GuildDB }); + try { + cmd.SlashCommand.run(this, interaction, args, { GuildDB }, start); // start is only used in ping / stats command + } catch (err) { + client.error(err) + const embed = new EmbedBuilder() + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setColor(client.config.Colors.Red) + + return interaction.send({ embeds: [embed] }); + } } });