12.8.3 fix internal error handling

This commit is contained in:
SowinskiBraeden committed 2022-10-16 13:07:32 -07:00
1 parent 060ef78db4
commit dad2cddf61
12 files changed
+211 -74

No files matched your search

+3 -3
View File
@@ -83,13 +83,13 @@ module.exports = {
let newInventory = new Inventory();
newInventory.createInventory(interaction.member.user.id, GuildDB.serverID);
newInventory.save().catch(err => {
if (err) return client.sendInternalError(err);
if (err) return client.sendInternalError(interaction, err);
});
} else inventory = inventory.inventory
if (!client.exists(inventory.guilds[GuildDB.serverID])) {
const success = addInventory(inventory.guilds, GuildDB.serverID, interaction.member.user.id, client);
if (!success) return client.sendInternalError('Failed to add inventory');
if (!success) return client.sendInternalError(interaction, 'Failed to add inventory');
}
if (args[0].name == "view") {
@@ -140,7 +140,7 @@ module.exports = {
}
client.dbo.collection("inventories").updateOne(query, update, function (err, res) {
if (err) return client.sendInternalError(err);
if (err) return client.sendInternalError(interaction, err);
});
let successEmbed = new EmbedBuilder()