diff --git a/commands/games/math-game.js b/commands/games/math-game.js index 645a7586..45e82ac0 100644 --- a/commands/games/math-game.js +++ b/commands/games/math-game.js @@ -28,7 +28,7 @@ module.exports = class MathGameCommand extends Command { async run(msg, args) { const { difficulty } = args; - const operation = operations[difficulty][Math.floor(Math.random() * operations.length)]; + const operation = operations[difficulty][Math.floor(Math.random() * operations[difficulty].length)]; const value1 = Math.floor(Math.random() * maxValues[difficulty]) + 1; const value2 = Math.floor(Math.random() * maxValues[difficulty]) + 1; const expression = `${value1} ${operation} ${value2}`;