mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-17 08:17:35 +02:00
23
This commit is contained in:
@@ -29,9 +29,8 @@ module.exports = class MathGameCommand extends Command {
|
||||
async run(msg, args) {
|
||||
const { difficulty } = args;
|
||||
const operation = operations[Math.floor(Math.random() * operations.length)];
|
||||
const maxValue = maxValues[difficulty];
|
||||
const value1 = Math.floor(Math.random() * maxValue) + 1;
|
||||
const value2 = Math.floor(Math.random() * maxValue) + 1;
|
||||
const value1 = Math.floor(Math.random() * maxValues[difficulty]) + 1;
|
||||
const value2 = Math.floor(Math.random() * maxValues[difficulty]) + 1;
|
||||
const expression = `${value1} ${operation} ${value2}`;
|
||||
const answer = math.eval(expression).toString();
|
||||
const embed = new RichEmbed()
|
||||
|
||||
Reference in New Issue
Block a user