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] 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();