use the forced phrase if it is specified
This commit is contained in:
parent
501f9d3d57
commit
86790e717a
6
index.js
6
index.js
|
@ -885,7 +885,13 @@ client.on('messageCreate', async message => {
|
||||||
|
|
||||||
function wordScramble() {
|
function wordScramble() {
|
||||||
// Get a random word from config.games.wordscramble.words then scramble it
|
// 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)];
|
word = config.games.wordscramble.words[Math.floor(Math.random() * config.games.wordscramble.words.length)];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
word = override;
|
||||||
|
]
|
||||||
scrambledWord = word.split('').sort(function () {
|
scrambledWord = word.split('').sort(function () {
|
||||||
// Fully scramble the word 3 times to be safe
|
// Fully scramble the word 3 times to be safe
|
||||||
return 0.5 - Math.random();
|
return 0.5 - Math.random();
|
||||||
|
|
Loading…
Reference in a new issue