12.8.3 fix internal error handling
This commit is contained in:
12 files changed
+211
-74
No files matched your search
+2
-2
@@ -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
|
||||
|
||||
Reference in new issue
Block a user