13.0.3 debug inventory give/drop

This commit is contained in:
SowinskiBraeden committed 2022-10-17 08:44:24 -07:00
1 parent a329779761
commit c427a5147f
2 files changed
+7 -16

No files matched your search

+6 -15
View File
@@ -125,15 +125,6 @@ module.exports = {
description: "Drop item from inventory",
value: "drop",
type: 1,
options: [
{
name: "item-number",
description: "Item to interact with",
value: 1,
type: 4,
required: true,
}
],
},
{
name: "clear",
@@ -255,7 +246,7 @@ module.exports = {
});
let message = new EmbedBuilder()
.setTitle(`You ${getActions[Math.floor(Math.random() * actions.length)]} a ${firearm.weaponType}`)
.setTitle(`You ${getActions[Math.floor(Math.random() * getActions.length)]} a ${firearm.weaponType}`)
.setColor(client.config.Colors.Default);
return interaction.send({ embeds: [message] });
@@ -275,7 +266,7 @@ module.exports = {
});
let message = new EmbedBuilder()
.setTitle(`You ${actions[Math.floor(Math.random() * actions.length)]} a ${item.name}`)
.setTitle(`You ${getActions[Math.floor(Math.random() * getActions.length)]} a ${item.name}`)
.setColor(client.config.Colors.Default);
return interaction.send({ embeds: [message] });
@@ -451,7 +442,7 @@ module.exports = {
let inventory = await client.dbo.collection("inventories").findOne({"inventory.userID": interaction.member.user.id}).then(inventory => inventory);
inventory = inventory.inventory;
let item = inventory.guilds[GuildDB.serverID].items[args[0].options[0].value-1];
let item = inventory.guilds[GuildDB.serverID].items[parseInt(interaction.values[0])];
client.dbo.collection('inventories').updateOne({'inventory.userID': interaction.member.user.id}, {$pull: {[`inventory.guilds.${GuildDB.serverID}.items`]: item}}, function(err, res) {
if (err) return client.sendInternalError(interaction, err);
@@ -477,7 +468,7 @@ module.exports = {
let inventory = await client.dbo.collection("inventories").findOne({"inventory.userID": interaction.member.user.id}).then(inventory => inventory);
inventory = inventory.inventory;
let item = inventory.guilds[GuildDB.serverID].items[interaction.values[0]];
let item = inventory.guilds[GuildDB.serverID].items[parseInt(interaction.values[0])];
let targetUserID = interaction.customId.split('-')[1].replace('<@!', '').replace('>', '');
let targetUserInventory = await client.dbo.collection("inventories").findOne({"inventory.userID":targetUserID}).then(inventory => inventory);
@@ -490,7 +481,7 @@ module.exports = {
if (err) return client.sendInternalError(interaction, err);
});
} else {
targetUserInventory = targetUserIventory.inventory;
targetUserInventory = targetUserInventory.inventory;
if (!client.exists(targetUserInventory.guilds[GuildDB.serverID])) {
const success = addInventory(inventory.guilds, GuildDB.serverID, targetUserID, client);
if (!success) {
@@ -513,7 +504,7 @@ module.exports = {
let successEmbed = new EmbedBuilder()
.setTitle('Success')
.setDescription(`Successfully gave <@${targetUserID}> ${item.name}`)
.setDescription(`Successfully gave <@${targetUserID}> ${item.type == 'fireamm' ? item.weaponType : item.name}`)
.setColor(client.config.Colors.Green);
return interaction.update({ embeds: [successEmbed], components: [] });