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