better error handling

This commit is contained in:
SowinskiBraeden committed 2022-08-27 20:14:21 -07:00
1 parent ea799693de
commit 28b73e3a8f
14 files changed
+160 -157

No files matched your search

+6 -6
View File
@@ -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] });