diff --git a/commands/inventory.js b/commands/inventory.js index 6602924..236e4ba 100644 --- a/commands/inventory.js +++ b/commands/inventory.js @@ -217,14 +217,14 @@ module.exports = { // Display wallet let item = inventory.guilds[GuildDB.serverID].items[0]; - let ID = `${client.exists(item.ID.firstname) ? item.ID.firstname : '...'} ${client.exists(item.ID.lastname) ? item.ID.lastname : '...'} | ${client.exists(item.ID.dob) ? item.ID.dob : 'N/A'} | ${client.exists(item.ID.addr) ? item.ID.addr : 'N/A'}` + let ID = `**FN** ${client.exists(item.ID.firstname) ? `${item.ID.firstname}` : '...'} **LN** ${client.exists(item.ID.lastname) ? item.ID.lastname : '...'} **DOB** ${client.exists(item.ID.dob) ? item.ID.dob : 'N/A'}\n**Address** ${client.exists(item.ID.addr) ? item.ID.addr : 'N/A'} **Height** ${client.exists(item.ID.height) ? item.ID.height : 'N/A'} **Weight** ${client.exists(item.ID.weight) ? item.ID.weight : 'N/A'}\n**Eye Color** ${client.exists(item.ID.eyeColor) ? item.ID.eyeColor : 'N/A'} **Hair Color** ${client.exists(item.ID.hairColor) ? item.ID.hairColor : 'N/A'} **Sex** ${client.exists(item.ID.sex) ? item.ID.sex : 'N/A'}` let walletEmbed = new EmbedBuilder() .setTitle(`Your Wallet`) .setColor(client.config.Colors.Default) .addFields( { name: '**Cash**', value: `$${item.cash.toFixed(2)}`, inline: true }, - { name: '**ID**', value: ID, inline: true }); + { name: '**ID**', value: ID, inline: false }); return interaction.send({ embeds: [walletEmbed] }); @@ -399,13 +399,13 @@ module.exports = { let itemEmbed = new EmbedBuilder().setColor(client.config.Colors.Default); if (item.type == 'wallet') { // Display wallet - - let ID = `${client.exists(item.ID.firstname) ? item.ID.firstname : '...'} ${client.exists(item.ID.lastname) ? item.ID.lastname : '...'} | ${client.exists(item.ID.dob) ? item.ID.dob : 'N/A'} | ${client.exists(item.ID.addr) ? item.ID.addr : 'N/A'}` + + let ID = `**FN** ${client.exists(item.ID.firstname) ? `${item.ID.firstname}` : '...'} **LN** ${client.exists(item.ID.lastname) ? item.ID.lastname : '...'} **DOB** ${client.exists(item.ID.dob) ? item.ID.dob : 'N/A'}\n**Address** ${client.exists(item.ID.addr) ? item.ID.addr : 'N/A'} **Height** ${client.exists(item.ID.height) ? item.ID.height : 'N/A'} **Weight** ${client.exists(item.ID.weight) ? item.ID.weight : 'N/A'}\n**Eye Color** ${client.exists(item.ID.eyeColor) ? item.ID.eyeColor : 'N/A'} **Hair Color** ${client.exists(item.ID.hairColor) ? item.ID.hairColor : 'N/A'} **Sex** ${client.exists(item.ID.sex) ? item.ID.sex : 'N/A'}` itemEmbed.setTitle(`Your Wallet`); itemEmbed.addFields( { name: '**Cash**', value: `$${item.cash.toFixed(2)}`, inline: true }, - { name: '**ID**', value: ID, inline: true }); + { name: '**ID**', value: ID, inline: false }); } else if (item.type == 'firearm') { // Display firearm diff --git a/commands/search.js b/commands/search.js index c817561..c733794 100644 --- a/commands/search.js +++ b/commands/search.js @@ -100,7 +100,7 @@ module.exports = { itemEmbed.setTitle(`${User.tag.split('#')[0]}'s Wallet`); itemEmbed.addFields( { name: '**Cash**', value: `$${item.cash.toFixed(2)}`, inline: true }, - { name: '**ID**', value: ID, inline: true }); + { name: '**ID**', value: ID, inline: false }); } else if (item.type == 'firearm') { // Display firearm diff --git a/commands/wallet.js b/commands/wallet.js index 6f95af9..643b5ff 100644 --- a/commands/wallet.js +++ b/commands/wallet.js @@ -31,7 +31,10 @@ module.exports = { required: true, choices: [ { name: "firstname", value: "firstname" }, { name: "lastname", value: "lastname" }, - { name: "dob", value: "dob" }, { name: "address", value: "address" }, + { name: "date of birth", value: "dob" }, { name: "address", value: "addr" }, + { name: "eye color", value: "eyeColor" }, { name: "height", value: "height" }, + { name: "weight", value: "weight" }, { name: "sex", value: "sex" }, + { name: "hair color", value: "hairColor" }, ] }, { @@ -72,7 +75,13 @@ module.exports = { ID: { firstname: '', lastname: '', - dob: '' + dob: '', + addr: '', + height: '', + weight: '', + eyeColor: '', + hairColor: '', + sex: '', } }] } @@ -96,30 +105,24 @@ module.exports = { // Display wallet let item = inventory.guilds[GuildDB.serverID].items[0]; - let ID = `${client.exists(item.ID.firstname) ? item.ID.firstname : '...'} ${client.exists(item.ID.lastname) ? item.ID.lastname : '...'} | ${client.exists(item.ID.dob) ? item.ID.dob : 'N/A'} | ${client.exists(item.ID.addr) ? item.ID.addr : 'N/A'}` + let ID = `**FN** ${client.exists(item.ID.firstname) ? `${item.ID.firstname}` : '...'} **LN** ${client.exists(item.ID.lastname) ? item.ID.lastname : '...'} **DOB** ${client.exists(item.ID.dob) ? item.ID.dob : 'N/A'}\n**Address** ${client.exists(item.ID.addr) ? item.ID.addr : 'N/A'} **Height** ${client.exists(item.ID.height) ? item.ID.height : 'N/A'} **Weight** ${client.exists(item.ID.weight) ? item.ID.weight : 'N/A'}\n**Eye Color** ${client.exists(item.ID.eyeColor) ? item.ID.eyeColor : 'N/A'} **Hair Color** ${client.exists(item.ID.hairColor) ? item.ID.hairColor : 'N/A'} **Sex** ${client.exists(item.ID.sex) ? item.ID.sex : 'N/A'}` let walletEmbed = new EmbedBuilder() .setTitle(`Your Wallet`) .setColor(client.config.Colors.Default) .addFields( { name: '**Cash**', value: `$${item.cash.toFixed(2)}`, inline: true }, - { name: '**ID**', value: ID, inline: true }); + { name: '**ID**', value: ID, inline: false }); return interaction.send({ embeds: [walletEmbed] }); } else if (args[0].name == "id-set") { const query = {"inventory.userID":interaction.member.user.id, [`inventory.guilds.${GuildDB.serverID}.items.type`]:"wallet"}; - let update, updateAction; - if (args[0].options[0].value == "firstname") { - update = {$set: {[`inventory.guilds.${GuildDB.serverID}.ID.firstname`]: args[0].options[1].value}}; - updateAction = "firstname"; + let update = {$set: {[`inventory.guilds.${GuildDB.serverID}.items.$.ID.${args[0].options[0].value}`]: args[0].options[1].value}}; + let updateAction = args[0].options[0].name; - } else if (args[0].options[0].value == "lastname") { - update = {$set: {[`inventory.guilds.${GuildDB.serverID}.ID.lastname`]: args[0].options[1].value}}; - updateAction = "lastname"; - - } else if (args[0].options[0].value == "dob") { + if (args[0].options[0].value == "dob") { const isDate = (date) => { return (new Date(date) !== "Invalid Date") && !isNaN(new Date(date)); } @@ -131,12 +134,6 @@ module.exports = { return interaction.send({ embeds: [embed] }); } - - update = {$set: {[`inventory.guilds.${GuildDB.serverID}.ID.dob`]: args[0].options[1].value}}; - updateAction = "date of birth"; - } else if (args[0].options[0].value == "address") { - update = {$set: {[`inventory.guilds.${GuildDB.serverID}.ID.addr`]: args[0].options[1].value}}; - updateAction = "address"; } client.dbo.collection("inventories").updateOne(query, update, function (err, res) { diff --git a/config/config.js b/config/config.js index 1e962cf..a533a0e 100644 --- a/config/config.js +++ b/config/config.js @@ -2,7 +2,7 @@ require('dotenv').config(); module.exports = { Dev: "PROD.", - Version: "13.0.4", // (major).(feature).(revision/bug/refactoring) + Version: "13.1.0", // (major).(feature).(revision/bug/refactoring) Admins: ["362791661274660874", "329371697570381824"], // Admins of the bot DefaultPrefix: "?", ServerID: "955668596745461830", diff --git a/structures/inventory.js b/structures/inventory.js index fd0e741..bb6e2c8 100644 --- a/structures/inventory.js +++ b/structures/inventory.js @@ -11,6 +11,11 @@ const defaultGuildData = { lastname: '', dob: '', addr: '', + height: '', + weight: '', + eyeColor: '', + hairColor: '', + sex: '', } }], lastWork: new Date('2000-01-01T00:00:00') // garantee's they can work right after inventory create,