use the forced phrase if it is specified

This commit is contained in:
Darien Rousseau 2023-09-04 15:35:22 -06:00 committed by GitHub
parent 501f9d3d57
commit 86790e717a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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