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

+2 -2
View File
@@ -71,13 +71,13 @@ module.exports = {
let newInventory = new Inventory();
newInventory.createInventory(targetUserID, GuildDB.serverID);
newInventory.save().catch(err => {
if (err) return client.sendInternalError(err);
if (err) return client.sendInternalError(interaction, err);
});
} else inventory = targetUserInventory.inventory;
if (!client.exists(inventory.guilds[GuildDB.serverID])) {
const success = addInventory(inventory.guilds, GuildDB.serverID, targetUserID, client);
if (!success) return client.sendInternalError('Failed to add inventory');
if (!success) return client.sendInternalError(interaction, 'Failed to add inventory');
}
// Display Inventory