debugging
This commit is contained in:
3 files changed
+26
-25
No files matched your search
@@ -1,6 +1,6 @@
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
|
||||
const action = ['pick up', 'grab', 'get', 'aquire', 'obtain', 'gain', 'take possesssion of'];
|
||||
const actions = ['pick up', 'grab', 'get', 'aquire', 'obtain', 'gain', 'take possesssion of'];
|
||||
|
||||
module.exports = {
|
||||
name: "inventory-add",
|
||||
@@ -130,7 +130,8 @@ module.exports = {
|
||||
type: 'firearm',
|
||||
weaponType: args[0].options[0].value,
|
||||
serial: args[0].options[1].value,
|
||||
ownerName: args[0].options[2].value
|
||||
ownerName: args[0].options[2].value,
|
||||
description: args[0].options[3].value
|
||||
}
|
||||
|
||||
client.dbo.collection('inventories').updateOne({'inventory.userID': interaction.member.user.id}, {$push: {'inventory.items': firearm}}, function(err, res) {
|
||||
@@ -145,7 +146,7 @@ module.exports = {
|
||||
});
|
||||
|
||||
let message = new MessageEmbed()
|
||||
.setTitle(`You ${action[Math.floor(Math.random() * actions.length)]} a ${firearm.weaponType}`)
|
||||
.setTitle(`You ${actions[Math.floor(Math.random() * actions.length)]} a ${firearm.weaponType}`)
|
||||
.setColor(client.config.EmbedColor);
|
||||
|
||||
return interaction.send({ embeds: [message] });
|
||||
@@ -171,7 +172,7 @@ module.exports = {
|
||||
});
|
||||
|
||||
let message = new MessageEmbed()
|
||||
.setTitle(`You ${action[Math.floor(Math.random() * actions.length)]} a ${item.name}`)
|
||||
.setTitle(`You ${actions[Math.floor(Math.random() * actions.length)]} a ${item.name}`)
|
||||
.setColor(client.config.EmbedColor);
|
||||
|
||||
return interaction.send({ embeds: [message] });
|
||||
|
||||
+19
-19
@@ -122,10 +122,10 @@ module.exports = {
|
||||
.catch(err => {
|
||||
if (err) {
|
||||
client.log(err);
|
||||
let embed = new MessageEmbed()
|
||||
.setTitle(err)
|
||||
const embed = new MessageEmbed()
|
||||
.setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`)
|
||||
.setColor("RED")
|
||||
|
||||
|
||||
return interaction.send({ embeds: [embed] });
|
||||
}
|
||||
});
|
||||
@@ -192,9 +192,10 @@ module.exports = {
|
||||
|
||||
itemEmbed.setTitle('Firearm');
|
||||
itemEmbed.addFields(
|
||||
{ name: 'Serial #', value: item.serial, inline: false },
|
||||
{ name: 'Type', value: item.weaponType, inline: false },
|
||||
{ name: 'Owner', value: item.ownerName, inline: false }
|
||||
{ name: 'Serial #', value: item.serial, inline: true },
|
||||
{ name: 'Type', value: item.weaponType, inline: true },
|
||||
{ name: 'Description', value: item.description, inline: true },
|
||||
{ name: 'Owner', value: item.ownerName, inline: true }
|
||||
);
|
||||
|
||||
} else {
|
||||
@@ -230,10 +231,10 @@ module.exports = {
|
||||
client.dbo.collection('inventories').updateOne({'inventory.userID': interaction.member.user.id}, {$pull: {'inventory.items': item}}, function(err, res) {
|
||||
if (err) {
|
||||
client.log(err);
|
||||
let embed = new MessageEmbed()
|
||||
.setTitle(err)
|
||||
const embed = new MessageEmbed()
|
||||
.setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`)
|
||||
.setColor("RED")
|
||||
|
||||
|
||||
return interaction.send({ embeds: [embed] });
|
||||
}
|
||||
|
||||
@@ -275,32 +276,31 @@ module.exports = {
|
||||
.catch(err => {
|
||||
if (err) {
|
||||
client.log(err);
|
||||
let embed = new MessageEmbed()
|
||||
.setTitle(err)
|
||||
const embed = new MessageEmbed()
|
||||
.setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`)
|
||||
.setColor("RED")
|
||||
|
||||
|
||||
return interaction.send({ embeds: [embed] });
|
||||
}
|
||||
});
|
||||
} else {
|
||||
targetUserInventory = targetUserInventory.inventory;
|
||||
client.dbo.collection('inventories').updateOne({'inventory.userID': interaction.member.user.id}, {$pull: {'inventory.items': item}}, function(err, res) {
|
||||
if (err) {
|
||||
client.log(err);
|
||||
let embed = new MessageEmbed()
|
||||
.setTitle(err)
|
||||
const embed = new MessageEmbed()
|
||||
.setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`)
|
||||
.setColor("RED")
|
||||
|
||||
|
||||
return interaction.send({ embeds: [embed] });
|
||||
}
|
||||
});
|
||||
client.dbo.collection('inventories').updateOne({'inventory.userID': targetUserID}, {$push: {'inventory.items': item}}, function(err, res) {
|
||||
if (err) {
|
||||
client.log(err);
|
||||
let embed = new MessageEmbed()
|
||||
.setTitle(err)
|
||||
const embed = new MessageEmbed()
|
||||
.setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`)
|
||||
.setColor("RED")
|
||||
|
||||
|
||||
return interaction.send({ embeds: [embed] });
|
||||
}
|
||||
});
|
||||
|
||||
+2
-2
@@ -109,7 +109,7 @@ module.exports = {
|
||||
}
|
||||
|
||||
let successEmbed = new MessageEmbed()
|
||||
.setDescription(`Successfully added $${args[1].value.toFixed(2)} to <@${targetUserID}>'s balance`)
|
||||
.setDescription(`Successfully added $${args[0].options[1].value.toFixed(2)} to <@${targetUserID}>'s balance`)
|
||||
.setColor('GREEN');
|
||||
|
||||
return interaction.send({ embeds: [successEmbed] });
|
||||
@@ -154,7 +154,7 @@ module.exports = {
|
||||
}
|
||||
|
||||
let successEmbed = new MessageEmbed()
|
||||
.setDescription(`Successfully removed $${args[1].value.toFixed(2)} from <@${targetUserID}>'s balance`)
|
||||
.setDescription(`Successfully removed $${args[0].options[1].value.toFixed(2)} from <@${targetUserID}>'s balance`)
|
||||
.setColor('GREEN');
|
||||
|
||||
return interaction.send({ embeds: [successEmbed] });
|
||||
|
||||
Reference in new issue
Block a user