mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-27 14:18:36 +02:00
Horse Race Command
This commit is contained in:
@@ -34,8 +34,8 @@ module.exports = class RollCommand extends Command {
|
||||
|
||||
run(msg, { maxValue, minValue }) {
|
||||
let result;
|
||||
if (!minValue) result = Math.floor(Math.random() * maxValue) + 1;
|
||||
else result = randomRange(minValue, maxValue);
|
||||
if (minValue) result = randomRange(minValue, maxValue);
|
||||
else result = Math.floor(Math.random() * maxValue) + 1;
|
||||
return msg.say(`You rolled a ${formatNumber(result)}.`);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user