From 49ac22a076ac0d619f46471b71e6a3f61017f6f9 Mon Sep 17 00:00:00 2001 From: ChrisChrome Date: Fri, 18 Aug 2023 18:30:41 -0600 Subject: [PATCH 01/23] > Change the chances of word scramble --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index d336650..536457f 100644 --- a/index.js +++ b/index.js @@ -848,7 +848,7 @@ client.on('messageCreate', async message => { return; } // 1 in 50 chance to start a word scramble - if (Math.floor(Math.random() * 10) == 0) { + if (Math.floor(Math.random() * 25) == 0) { // Start a word scramble setCooldown({id: 0}, "wordscramble", 5 * 60 * 1000) gameData = wordScramble(); From 2d7d29195af6707de6fabf6014ae29ddc5f95ac9 Mon Sep 17 00:00:00 2001 From: ChrisChrome Date: Sat, 19 Aug 2023 09:47:35 -0600 Subject: [PATCH 02/23] Fuck you Jukebox --- index.js | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/index.js b/index.js index 536457f..2d4d9dc 100644 --- a/index.js +++ b/index.js @@ -514,10 +514,10 @@ client.on("interactionCreate", async interaction => { }); // Get the slot results, yes it's pre-defined, but it's not like it matters - slotResults = playSlotMachine(); - // If there is a slotResults.cooldownOverride use that instead - if (slotResults.cooldownOverride) { - setCooldown(interaction.user, "slots", slotResults.cooldownOverride * 60 * 1000) + slotResults[interaction.user.id] = playSlotMachine(); + // If there is a slotResults[interaction.user.id].cooldownOverride use that instead + if (slotResults[interaction.user.id].cooldownOverride) { + setCooldown(interaction.user, "slots", slotResults[interaction.user.id].cooldownOverride * 60 * 1000) } else { setCooldown(interaction.user, "slots", config.games.slots.cooldown * 60 * 1000) } @@ -530,7 +530,7 @@ client.on("interactionCreate", async interaction => { }); // Check if they won or lost, if they won, give them the prize - difference = await new Number(slotResults.coinDifference); + difference = await new Number(slotResults[interaction.user.id].coinDifference); // If they lost subtract 3 coins from the difference if (difference <= 0) difference -= 3; // Wait 4 seconds, then one at a time change the slots, 1 second apart @@ -538,7 +538,7 @@ client.on("interactionCreate", async interaction => { await interaction.editReply({ embeds: [{ title: "Slots", - description: `[${slotResults.spinResult[0]}][${config.games.slots.spinning}][${config.games.slots.spinning}]`, + description: `[${slotResults[interaction.user.id].spinResult[0]}][${config.games.slots.spinning}][${config.games.slots.spinning}]`, color: 0xffff00 }] }, 1000); @@ -546,7 +546,7 @@ client.on("interactionCreate", async interaction => { await interaction.editReply({ embeds: [{ title: "Slots", - description: `[${slotResults.spinResult[0]}][${slotResults.spinResult[1]}][${config.games.slots.spinning}]`, + description: `[${slotResults[interaction.user.id].spinResult[0]}][${slotResults[interaction.user.id].spinResult[1]}][${config.games.slots.spinning}]`, color: 0xffff00 }] }, 1000); @@ -554,24 +554,24 @@ client.on("interactionCreate", async interaction => { await interaction.editReply({ embeds: [{ title: "Slots", - description: `[${slotResults.spinResult[0]}][${slotResults.spinResult[1]}][${slotResults.spinResult[2]}]`, + description: `[${slotResults[interaction.user.id].spinResult[0]}][${slotResults[interaction.user.id].spinResult[1]}][${slotResults[interaction.user.id].spinResult[2]}]`, color: 0xffff00 }] }); if (difference > 0) { - if (slotResults.jackpot) { + if (slotResults[interaction.user.id].jackpot) { return await interaction.editReply({ embeds: [{ title: "Jackpot!", - description: `:rotating_light: [${slotResults.spinResult[0]}][${slotResults.spinResult[1]}][${slotResults.spinResult[2]}] :rotating_light:\nYou won the jackpot! (${difference} coins)`, + description: `:rotating_light: [${slotResults[interaction.user.id].spinResult[0]}][${slotResults[interaction.user.id].spinResult[1]}][${slotResults[interaction.user.id].spinResult[2]}] :rotating_light:\nYou won the jackpot! (${difference} coins)`, color: 0xffffff }] }); - } else if (slotResults.triple) { + } else if (slotResults[interaction.user.id].triple) { return await interaction.editReply({ embeds: [{ title: "Triple!", - description: `[${slotResults.spinResult[0]}][${slotResults.spinResult[1]}][${slotResults.spinResult[2]}]\nYou won ${difference} coins!`, + description: `[${slotResults[interaction.user.id].spinResult[0]}][${slotResults[interaction.user.id].spinResult[1]}][${slotResults[interaction.user.id].spinResult[2]}]\nYou won ${difference} coins!`, color: 0x00ffff }] }); @@ -579,19 +579,19 @@ client.on("interactionCreate", async interaction => { await interaction.editReply({ embeds: [{ title: "Slots", - description: `[${slotResults.spinResult[0]}][${slotResults.spinResult[1]}][${slotResults.spinResult[2]}]\nYou won ${difference} coins! (You get your play fee back)`, + description: `[${slotResults[interaction.user.id].spinResult[0]}][${slotResults[interaction.user.id].spinResult[1]}][${slotResults[interaction.user.id].spinResult[2]}]\nYou won ${difference} coins! (You get your play fee back)`, color: 0x00ff00 }] }); } } else { // They lost, sad - if (slotResults.bombs) { + if (slotResults[interaction.user.id].bombs) { // Triple bombs, very sad await interaction.editReply({ embeds: [{ title: "Bombs!", - description: `[${slotResults.spinResult[0]}][${slotResults.spinResult[1]}][${slotResults.spinResult[2]}]\nYou lost ${Math.abs(difference)} coins!`, + description: `[${slotResults[interaction.user.id].spinResult[0]}][${slotResults[interaction.user.id].spinResult[1]}][${slotResults[interaction.user.id].spinResult[2]}]\nYou lost ${Math.abs(difference)} coins!`, color: 0xff0000 }] }); @@ -599,7 +599,7 @@ client.on("interactionCreate", async interaction => { await interaction.editReply({ embeds: [{ title: "Slots", - description: `[${slotResults.spinResult[0]}][${slotResults.spinResult[1]}][${slotResults.spinResult[2]}]\nYou lost ${Math.abs(difference)} coins!`, + description: `[${slotResults[interaction.user.id].spinResult[0]}][${slotResults[interaction.user.id].spinResult[1]}][${slotResults[interaction.user.id].spinResult[2]}]\nYou lost ${Math.abs(difference)} coins!`, color: 0xff0000 }] }); From 42f8c4e385ef276d76cb4fa2905b9664119975bc Mon Sep 17 00:00:00 2001 From: ChrisChrome Date: Sat, 19 Aug 2023 09:48:37 -0600 Subject: [PATCH 03/23] A --- index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.js b/index.js index 2d4d9dc..8db0e8f 100644 --- a/index.js +++ b/index.js @@ -148,6 +148,8 @@ setCooldown = (user, type, cooldown) => { }); } +var slotResults = {}; + client.on("interactionCreate", async interaction => { if (!interaction.isCommand()) return; switch (interaction.commandName) { From 91e597497aa8d11f7924b6d6a4aae9b57a4d59b2 Mon Sep 17 00:00:00 2001 From: ChrisChrome Date: Sat, 19 Aug 2023 14:17:10 -0600 Subject: [PATCH 04/23] Some debug stuff --- commands.json | 20 ++++++++++---------- index.js | 1 + 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/commands.json b/commands.json index 0b30880..0239380 100644 --- a/commands.json +++ b/commands.json @@ -105,15 +105,7 @@ { "name": "coins", "description": "Check the coins of yourself or another user", - "type": 1, - "options": [ - { - "name": "user", - "description": "The user to check", - "type": 6, - "required": false - } - ] + "type": 1 }, { "name": "ledger", @@ -123,7 +115,15 @@ { "name": "slots", "description": "Play the slots (Costs 3 coins)", - "type": 1 + "type": 1, + "options":[ + { + "name": "rig", + "description": "DEBUG: Rig the slots to specific values", + "type": 3, + "required": true + } + ] }, { "name": "coinflip", diff --git a/index.js b/index.js index 8db0e8f..7d499e8 100644 --- a/index.js +++ b/index.js @@ -1,4 +1,5 @@ const config = require("./config.json"); +if (!config.debug) config.debug = false; const Discord = require("discord.js"); const rest = new Discord.REST({ version: '10' From 2635f77f5ecaab127b7de9e37bf4ba7676b1ec63 Mon Sep 17 00:00:00 2001 From: Darien Rousseau <45698803+not-pyroman@users.noreply.github.com> Date: Fri, 1 Sep 2023 01:14:41 -0600 Subject: [PATCH 05/23] correct transfer receipts and make the tax be added onto transferred amount --- index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 7d499e8..8c38e9e 100644 --- a/index.js +++ b/index.js @@ -410,14 +410,14 @@ client.on("interactionCreate", async interaction => { ephemeral: true }); // Now check if they have enough for the tax - if (balance < amount) return interaction.reply({ + if (balance < amount * 1.25) return interaction.reply({ content: `You do not have enough coins to pay the tax of ${config.discord.coin}${amount * 0.25}. You only have ${config.discord.coin}${balance}.`, ephemeral: true }); // At this point we know they have enough coins, so we can take them away, make sure to take the tax away too - checkAndModifyPoints(interaction.user, -amount); + checkAndModifyPoints(interaction.user, -amount * 1.25); // Now we can give the other user the coins - checkAndModifyPoints(interaction.options.getMember("user").user, amount * 0.75); + checkAndModifyPoints(interaction.options.getMember("user").user, amount); // Now we can tell the user that it worked // get the amount sent with 2 decimal places if it has a decimal if (amount % 1 != 0) { @@ -442,7 +442,7 @@ client.on("interactionCreate", async interaction => { embeds: [{ title: "Transfer Receipt", color: 0xffff00, - description: `You sent ${config.discord.coin}${amount} to ${interaction.options.getMember("user").user}.\nYou paid a tax of ${config.discord.coin}${amount}.` + description: `You sent ${config.discord.coin}${amount} to ${interaction.options.getMember("user").user}.\nYou paid a tax of ${config.discord.coin}${amount * 0.25}.` }] }).catch(err => { }); From 03dfaf9db3450c3cd68cf532f0d47093f5e01205 Mon Sep 17 00:00:00 2001 From: Darien Rousseau <45698803+not-pyroman@users.noreply.github.com> Date: Mon, 4 Sep 2023 15:06:00 -0600 Subject: [PATCH 06/23] silly Chris that was there for a reason! Fix the /coins command --- commands.json | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/commands.json b/commands.json index 0239380..b93c861 100644 --- a/commands.json +++ b/commands.json @@ -105,7 +105,15 @@ { "name": "coins", "description": "Check the coins of yourself or another user", - "type": 1 + "type": 1, + "options": [ + { + "name": "user", + "description": "The user to check", + "type": 6, + "required": false + } + ] }, { "name": "ledger", From 501f9d3d578d3fbd1cb2aea03b718b6d64d7d561 Mon Sep 17 00:00:00 2001 From: Darien Rousseau <45698803+not-pyroman@users.noreply.github.com> Date: Mon, 4 Sep 2023 15:34:37 -0600 Subject: [PATCH 07/23] allow the ability to specify a word in /wordscramble --- commands.json | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/commands.json b/commands.json index b93c861..13093f7 100644 --- a/commands.json +++ b/commands.json @@ -85,7 +85,7 @@ }, { "name": "transfer", - "description": "Transfer coins to another user (2:1 ratio)", + "description": "Transfer coins to another user (4:3 ratio)", "type": 1, "options": [ { @@ -226,6 +226,14 @@ { "name": "wordscramble", "description": "Trigger a word scramble (admin only)", - "type": 1 + "type": 1, + "options":[ + { + "name": "override", + "description": "Force the specified string/word instead of the random option", + "type": 3, + "required": false + } + ] } ] From 86790e717ab25f185fd858ccc19ec53f3aa953c1 Mon Sep 17 00:00:00 2001 From: Darien Rousseau <45698803+not-pyroman@users.noreply.github.com> Date: Mon, 4 Sep 2023 15:35:22 -0600 Subject: [PATCH 08/23] use the forced phrase if it is specified --- index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 8c38e9e..189717d 100644 --- a/index.js +++ b/index.js @@ -885,7 +885,13 @@ client.on('messageCreate', async message => { function wordScramble() { // Get a random word from config.games.wordscramble.words then scramble it - word = config.games.wordscramble.words[Math.floor(Math.random() * config.games.wordscramble.words.length)]; + override = interaction.options.get("override").value; + if (!override) { + word = config.games.wordscramble.words[Math.floor(Math.random() * config.games.wordscramble.words.length)]; + } + else { + word = override; + ] scrambledWord = word.split('').sort(function () { // Fully scramble the word 3 times to be safe return 0.5 - Math.random(); From 2bd64d4bda07d4a399a051fef14947e1d535eee9 Mon Sep 17 00:00:00 2001 From: Darien Rousseau <45698803+not-pyroman@users.noreply.github.com> Date: Mon, 4 Sep 2023 15:36:20 -0600 Subject: [PATCH 09/23] whoops wrong symbol --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 189717d..a78fcf1 100644 --- a/index.js +++ b/index.js @@ -891,7 +891,7 @@ function wordScramble() { } else { word = override; - ] + } scrambledWord = word.split('').sort(function () { // Fully scramble the word 3 times to be safe return 0.5 - Math.random(); From 8b37f26fbb3ae94ba8f8da64592b6ff310e71484 Mon Sep 17 00:00:00 2001 From: Darien Rousseau <45698803+not-pyroman@users.noreply.github.com> Date: Mon, 4 Sep 2023 15:39:50 -0600 Subject: [PATCH 10/23] =?UTF-8?q?me=20when=20forgor=20=F0=9F=92=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index a78fcf1..b9604a8 100644 --- a/index.js +++ b/index.js @@ -785,7 +785,8 @@ client.on("interactionCreate", async interaction => { } // Start a word scramble - gameData = wordScramble(); + override = interaction.options.get("override").value; + gameData = wordScramble(override); wordScrambles[interaction.channel.id] = { word: gameData.word, scrambledWord: gameData.scrambledWord, @@ -885,7 +886,6 @@ client.on('messageCreate', async message => { function wordScramble() { // Get a random word from config.games.wordscramble.words then scramble it - override = interaction.options.get("override").value; if (!override) { word = config.games.wordscramble.words[Math.floor(Math.random() * config.games.wordscramble.words.length)]; } From 8475dc895ca01722b8199333c8d9cca33be46f7e Mon Sep 17 00:00:00 2001 From: Darien Rousseau <45698803+not-pyroman@users.noreply.github.com> Date: Mon, 4 Sep 2023 15:45:13 -0600 Subject: [PATCH 11/23] try to catch if we don't specify an override --- index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index b9604a8..274e4da 100644 --- a/index.js +++ b/index.js @@ -785,7 +785,12 @@ client.on("interactionCreate", async interaction => { } // Start a word scramble - override = interaction.options.get("override").value; + if (interaction.options.get("override")) { + override = interaction.options.get("override").value; + } + else { + override = false; + ] gameData = wordScramble(override); wordScrambles[interaction.channel.id] = { word: gameData.word, From 5a80ea71ffa84197a78c3a1838f94c5811bb7944 Mon Sep 17 00:00:00 2001 From: Darien Rousseau <45698803+not-pyroman@users.noreply.github.com> Date: Mon, 4 Sep 2023 15:46:11 -0600 Subject: [PATCH 12/23] History repeats itself and i keep forgetting to HOLD shift --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 274e4da..6b35bba 100644 --- a/index.js +++ b/index.js @@ -790,7 +790,7 @@ client.on("interactionCreate", async interaction => { } else { override = false; - ] + } gameData = wordScramble(override); wordScrambles[interaction.channel.id] = { word: gameData.word, From 744b19631055d8789093d807e1277e2a340fe746 Mon Sep 17 00:00:00 2001 From: Darien Rousseau Date: Mon, 4 Sep 2023 16:07:48 -0600 Subject: [PATCH 13/23] try to allow a custom payout for forced word scrambles --- commands.json | 10 ++++++++-- index.js | 13 ++++++++++--- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/commands.json b/commands.json index 13093f7..d183f80 100644 --- a/commands.json +++ b/commands.json @@ -127,9 +127,9 @@ "options":[ { "name": "rig", - "description": "DEBUG: Rig the slots to specific values", + "description": "Willing to put some lucky number/word? This option is for you!", "type": 3, - "required": true + "required": false } ] }, @@ -233,6 +233,12 @@ "description": "Force the specified string/word instead of the random option", "type": 3, "required": false + }, + { + "name": "amount", + "description": "The amount to pay for this forced scramble", + "type": 10, + "required": false } ] } diff --git a/index.js b/index.js index 6b35bba..75b8d6e 100644 --- a/index.js +++ b/index.js @@ -784,16 +784,23 @@ client.on("interactionCreate", async interaction => { }); } - // Start a word scramble + // Start a word scramble and check if we specified a word if (interaction.options.get("override")) { override = interaction.options.get("override").value; } else { override = false; + } ${wordScrambles.amount} + if (interaction.options.get("amount")) { + amount = interaction.options.getNumber("amount"); + } + else { + amount = 2; } gameData = wordScramble(override); wordScrambles[interaction.channel.id] = { word: gameData.word, + amount: amount, scrambledWord: gameData.scrambledWord, badGuesses: [] } @@ -836,12 +843,12 @@ client.on('messageCreate', async message => { // Check if the message is the correct answer if (message.content.toLowerCase() == wordScrambles[message.channel.id].word.toLowerCase()) { // Give the user a point - await checkAndModifyPoints(message.author, 2); + await checkAndModifyPoints(message.author, ${wordScrambles[message.channel.id].amount}); // Send the message message.channel.send({ embeds: [{ title: "Word Scramble", - description: `**${message.author}** got the word **${wordScrambles[message.channel.id].word}**!\nYou got 2 coins!`, + description: `**${message.author}** got the word **${wordScrambles[message.channel.id].word}**!\nYou got ${wordScrambles[message.channel.id].amount} coins!`, color: 0x00ff00 }] }); From 887cb37ed8d90caaf390245d282f2aa1629eeedb Mon Sep 17 00:00:00 2001 From: Darien Rousseau Date: Mon, 4 Sep 2023 16:09:05 -0600 Subject: [PATCH 14/23] whoops --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 75b8d6e..8c85374 100644 --- a/index.js +++ b/index.js @@ -790,7 +790,7 @@ client.on("interactionCreate", async interaction => { } else { override = false; - } ${wordScrambles.amount} + } if (interaction.options.get("amount")) { amount = interaction.options.getNumber("amount"); } From a7e6ab5f362369d78f9a53f125c0234399576553 Mon Sep 17 00:00:00 2001 From: Darien Rousseau Date: Mon, 4 Sep 2023 16:10:18 -0600 Subject: [PATCH 15/23] my brain is shutting down as we speak --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 8c85374..1b87b01 100644 --- a/index.js +++ b/index.js @@ -843,7 +843,7 @@ client.on('messageCreate', async message => { // Check if the message is the correct answer if (message.content.toLowerCase() == wordScrambles[message.channel.id].word.toLowerCase()) { // Give the user a point - await checkAndModifyPoints(message.author, ${wordScrambles[message.channel.id].amount}); + await checkAndModifyPoints(message.author, wordScrambles[message.channel.id].amount); // Send the message message.channel.send({ embeds: [{ From a230b392978f320b417a85980028c5e7e6f45cf8 Mon Sep 17 00:00:00 2001 From: Darien Rousseau Date: Mon, 4 Sep 2023 16:28:56 -0600 Subject: [PATCH 16/23] Reword&Correct the description of /transfer --- commands.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands.json b/commands.json index d183f80..2e9d6bb 100644 --- a/commands.json +++ b/commands.json @@ -85,7 +85,7 @@ }, { "name": "transfer", - "description": "Transfer coins to another user (4:3 ratio)", + "description": "Transfer coins to another user with a 25% tax", "type": 1, "options": [ { From 93bce4df0a721fcbafb13942ed795d01667d130c Mon Sep 17 00:00:00 2001 From: Darien Rousseau Date: Mon, 4 Sep 2023 16:40:04 -0600 Subject: [PATCH 17/23] No keeping forced variables when doing a random word scramble --- index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 1b87b01..bc82db4 100644 --- a/index.js +++ b/index.js @@ -867,10 +867,12 @@ client.on('messageCreate', async message => { if (Math.floor(Math.random() * 25) == 0) { // Start a word scramble setCooldown({id: 0}, "wordscramble", 5 * 60 * 1000) - gameData = wordScramble(); + override = false + gameData = wordScramble(override); wordScrambles[message.channel.id] = { word: gameData.word, scrambledWord: gameData.scrambledWord, + amount: 2, badGuesses: [] } message.channel.send({ From e2e116df717469c8aa3619bbe663fe2bacca3bfc Mon Sep 17 00:00:00 2001 From: Darien Rousseau Date: Mon, 4 Sep 2023 20:09:08 -0600 Subject: [PATCH 18/23] I forgor to push a change --- index.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index bc82db4..e4cb821 100644 --- a/index.js +++ b/index.js @@ -792,15 +792,15 @@ client.on("interactionCreate", async interaction => { override = false; } if (interaction.options.get("amount")) { - amount = interaction.options.getNumber("amount"); + coinamount = interaction.options.getNumber("amount"); } else { - amount = 2; + coinamount = 2; } gameData = wordScramble(override); wordScrambles[interaction.channel.id] = { word: gameData.word, - amount: amount, + amount: coinamount, scrambledWord: gameData.scrambledWord, badGuesses: [] } @@ -868,6 +868,7 @@ client.on('messageCreate', async message => { // Start a word scramble setCooldown({id: 0}, "wordscramble", 5 * 60 * 1000) override = false + coinamount = 2 gameData = wordScramble(override); wordScrambles[message.channel.id] = { word: gameData.word, From 770edd83f1f69b6a0d03b237620441b3c1015846 Mon Sep 17 00:00:00 2001 From: ChrisChrome Date: Thu, 28 Sep 2023 10:18:29 -0600 Subject: [PATCH 19/23] Make wordscramble a whitelist --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index e4cb821..1b625fd 100644 --- a/index.js +++ b/index.js @@ -643,7 +643,7 @@ client.on("interactionCreate", async interaction => { }); // Flip the coin - coin = Math.random() < 0.5 ? "heads" : "tails"; + coin = Math.random() < 0.6 ? "heads" : "tails"; before = await checkPoints(interaction.user); side = interaction.options.getString("side"); outcome = coin == side ? true : false; @@ -836,7 +836,7 @@ client.on('messageCreate', async message => { if (message.author.bot) return; if (!message.guild) return; if (message.channel.type == "dm") return; - if (config.games.wordscramble.blacklist.includes(message.channel.id)) return; + if (!config.games.wordscramble.whitelist.includes(message.channel.id)) return; // Check if the channel already has a word scramble going if (wordScrambles[message.channel.id]) { if (wordScrambles[message.channel.id].badGuesses.includes(message.author.id)) return; From 4e91ba17f8dd74db54123b5c47864fb4eb135750 Mon Sep 17 00:00:00 2001 From: ChrisChrome Date: Thu, 28 Sep 2023 10:22:51 -0600 Subject: [PATCH 20/23] Make whitelist work with categories --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 1b625fd..d2bc313 100644 --- a/index.js +++ b/index.js @@ -836,7 +836,7 @@ client.on('messageCreate', async message => { if (message.author.bot) return; if (!message.guild) return; if (message.channel.type == "dm") return; - if (!config.games.wordscramble.whitelist.includes(message.channel.id)) return; + if (!config.games.wordscramble.whitelist.includes(message.channel.id) && !config.games.wordscramble.whitelist.includes(message.channel.parentId)) return; // Check if the channel already has a word scramble going if (wordScrambles[message.channel.id]) { if (wordScrambles[message.channel.id].badGuesses.includes(message.author.id)) return; From 3b7defd187db29a8d1149f1f2744bb9e49214d94 Mon Sep 17 00:00:00 2001 From: ChrisChrome Date: Thu, 28 Sep 2023 10:28:53 -0600 Subject: [PATCH 21/23] oops --- index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index d2bc313..57404e0 100644 --- a/index.js +++ b/index.js @@ -836,7 +836,6 @@ client.on('messageCreate', async message => { if (message.author.bot) return; if (!message.guild) return; if (message.channel.type == "dm") return; - if (!config.games.wordscramble.whitelist.includes(message.channel.id) && !config.games.wordscramble.whitelist.includes(message.channel.parentId)) return; // Check if the channel already has a word scramble going if (wordScrambles[message.channel.id]) { if (wordScrambles[message.channel.id].badGuesses.includes(message.author.id)) return; @@ -859,14 +858,15 @@ client.on('messageCreate', async message => { wordScrambles[message.channel.id].badGuesses.push(message.author.id); } } else { - curCooldown = await checkCooldown({id: 0}, "wordscramble") + if (!config.games.wordscramble.whitelist.includes(message.channel.id) && !config.games.wordscramble.whitelist.includes(message.channel.parentId)) return; + curCooldown = await checkCooldown({ id: 0 }, "wordscramble") if (curCooldown) { return; } // 1 in 50 chance to start a word scramble if (Math.floor(Math.random() * 25) == 0) { // Start a word scramble - setCooldown({id: 0}, "wordscramble", 5 * 60 * 1000) + setCooldown({ id: 0 }, "wordscramble", 5 * 60 * 1000) override = false coinamount = 2 gameData = wordScramble(override); @@ -896,7 +896,7 @@ client.on('messageCreate', async message => { }, 30 * 1000); } } - setCooldown({id: 0}, "wordscramble", 1 * 60 * 1000) + setCooldown({ id: 0 }, "wordscramble", 1 * 60 * 1000) }); function wordScramble() { From 01fbdf69852cc5b6a9980df476be39297642ff0f Mon Sep 17 00:00:00 2001 From: ChrisChrome Date: Thu, 28 Sep 2023 10:31:12 -0600 Subject: [PATCH 22/23] Remove rig option from slots --- commands.json | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/commands.json b/commands.json index 2e9d6bb..0113c3d 100644 --- a/commands.json +++ b/commands.json @@ -123,15 +123,7 @@ { "name": "slots", "description": "Play the slots (Costs 3 coins)", - "type": 1, - "options":[ - { - "name": "rig", - "description": "Willing to put some lucky number/word? This option is for you!", - "type": 3, - "required": false - } - ] + "type": 1 }, { "name": "coinflip", From 0b51b8dc09cb5b304a9756ec24ee4c3756293a2c Mon Sep 17 00:00:00 2001 From: Mmadrid509 <63370132+mmadrid509@users.noreply.github.com> Date: Fri, 10 Nov 2023 18:32:25 -0800 Subject: [PATCH 23/23] Possibly fix the cooldowns of coinflip and snakeeyes cmd The cooldowns were being applied before checks, added it after so that it applies when the command goes fully through. --- index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 57404e0..16ef896 100644 --- a/index.js +++ b/index.js @@ -627,8 +627,7 @@ client.on("interactionCreate", async interaction => { ephemeral: true }); } - setCooldown(interaction.user, "coinflip", config.games.coinflip.cooldown * 60 * 1000) - + bet = parseInt(interaction.options.get("amount").value); if (bet < 1 || bet > 10) return interaction.reply({ content: "You can only bet between 1 and 10 coins.", @@ -651,6 +650,7 @@ client.on("interactionCreate", async interaction => { // if they lose inverse the bet if (!outcome) bet = -bet; await checkAndModifyPoints(interaction.user, bet); + setCooldown(interaction.user, "coinflip", config.games.coinflip.cooldown * 60 * 1000) if (coin == "heads") return interaction.reply({ embeds: [{ title: "Coinflip", @@ -689,7 +689,7 @@ client.on("interactionCreate", async interaction => { ephemeral: true }); } - setCooldown(interaction.user, "snakeeyes", config.games.snakeeyes.cooldown * 60 * 1000) + bet = parseInt(interaction.options.get("amount").value); if (bet < 1 || bet > 10) return interaction.reply({ @@ -703,7 +703,7 @@ client.on("interactionCreate", async interaction => { content: "You do not have enough coins to play snakeeyes.", ephemeral: true }); - + setCooldown(interaction.user, "snakeeyes", config.games.snakeeyes.cooldown * 60 * 1000) // Roll the dice dice = Math.floor(Math.random() * 6) + 1; before = points;