From 739f0bfe2879e0109d7bbb037ff48d9b9b0c3c5d Mon Sep 17 00:00:00 2001 From: Braeden Sowinski Date: Wed, 31 Aug 2022 11:21:15 -0700 Subject: [PATCH] fix incorrect option types, prepare casino setting --- commands/bank.js | 8 ++++---- commands/fine.js | 2 +- commands/money.js | 2 +- commands/settings.js | 37 ++++++++++++++++++++++++++++++++++--- config/config.js | 2 +- structures/QuarksBot.js | 2 ++ 6 files changed, 43 insertions(+), 10 deletions(-) diff --git a/commands/bank.js b/commands/bank.js index c776be6..202f5de 100644 --- a/commands/bank.js +++ b/commands/bank.js @@ -22,7 +22,7 @@ module.exports = { name: "amount", description: "Amount to deposit", value: "amount", - type: 5, + type: 10, min_value: 0.01, required: true, }] @@ -36,7 +36,7 @@ module.exports = { name: "amount", description: "Amount to withdraw", value: "amount", - type: 5, + type: 10, min_value: 0.01, required: true, }] @@ -71,7 +71,7 @@ module.exports = { name: "amount", description: "The amount to give", value: "amount", - type: 5, + type: 10, min_value: 0.01, required: true, }, @@ -94,7 +94,7 @@ module.exports = { name: "amount", description: "The amount to transfer", value: "amount", - type: 5, + type: 10, min_value: 0.01, required: true, }, diff --git a/commands/fine.js b/commands/fine.js index a3b1966..5b7bab8 100644 --- a/commands/fine.js +++ b/commands/fine.js @@ -23,7 +23,7 @@ module.exports = { name: "amount", description: "Amount the fine totals to", value: "amount", - type: 5, + type: 10, min_value: 0.01, required: true, } diff --git a/commands/money.js b/commands/money.js index 2269594..09b3379 100644 --- a/commands/money.js +++ b/commands/money.js @@ -26,7 +26,7 @@ module.exports = { name: "amount", description: "The amount to add to balance", value: "amount", - type: 5, + type: 10, min_value: 0.01, required: true, }, diff --git a/commands/settings.js b/commands/settings.js index 912c31d..5586e79 100644 --- a/commands/settings.js +++ b/commands/settings.js @@ -162,7 +162,7 @@ module.exports = { name: "amount", description: "The amount to set the starting balance", value: "amount", - type: 5, + type: 10, min_value: 0.01, required: true, }] @@ -190,7 +190,7 @@ module.exports = { name: "amount", description: "The amount to earn in 1 day of work", value: 120.00, - type: 5, + type: 10, min_value: 0.01, required: false, } @@ -332,6 +332,19 @@ module.exports = { required: true, }] }, + { + name: "casino_multiplier", + description: "Change the multuplier for the amount to win back in casino games", + value: "casino_win_multiplier", + type: 1, + options: [{ + name: "mutliplier", + description: "Set the multiplier for winnings", + value: 2, + type: 10, + min_value: 1, + }] + }, { name: "reset", description: "Restore all settings to default configurations", @@ -881,13 +894,31 @@ module.exports = { } }); - const title = setting ? 'Only officers can use /search' : 'Any user can use /search'; + const title = setting ? 'True: Only officers can use /search' : 'False: Any user can use /search'; const successEmbed = new EmbedBuilder() .setColor(client.config.Colors.Green) .setTitle(title) return interaction.send({ embeds: [successEmbed] }); + } else if (args[0].name == 'casino_multiplier') { + client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID}, {$set: {"server.casinoMultiplier": args[0].options[0]}}, function(err, res) { + if (err) { + client.error(err); + const embed = new EmbedBuilder() + .setDescription(`**Internal Error:**\nUh Oh D: Its not you, its me.\nThis command has crashed\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) + .setColor(client.config.Colors.Red); + + return interaction.send({ embeds: [embed] }); + } + }); + + const successEmbed = new EmbedBuilder() + .setColor(client.config.Colors.Green) + .setDescription(`**Success:** Set casino winnings multiplier to **${args[0].options[0]}x**`); + + return interaction.send({ embeds: [successEmbed] }); + } else if (args[0].name == 'reset') { const prompt = new EmbedBuilder() .setTitle(`Woah!? Hold on.`) diff --git a/config/config.js b/config/config.js index 838b272..7a1dee7 100644 --- a/config/config.js +++ b/config/config.js @@ -1,6 +1,6 @@ module.exports = { Dev: "PROD.", - Version: "12.2.0", + Version: "12.3.1", Admins: ["362791661274660874", "329371697570381824"], // Admins of the bot DefaultPrefix: "?", ServerID: "955668596745461830", diff --git a/structures/QuarksBot.js b/structures/QuarksBot.js index e59c431..0889ff8 100644 --- a/structures/QuarksBot.js +++ b/structures/QuarksBot.js @@ -159,6 +159,7 @@ class QuarksBot extends Client { officerRole: null, dispatcherRole: null, onlyOfficersSearch: false, + casinoMultiplier: 2, } } this.dbo.collection("guilds").insertOne(guild, function(err, res) { @@ -182,6 +183,7 @@ class QuarksBot extends Client { dispatcherRole: guild.server.dispatcherRole, onlyOfficersSearch: guild.server.onlyOfficersSearch, botAdmin: guild.server.botAdmin, + casinoMultiplier: guild.server.casinoMultiplier, } return guildData; }