mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-15 00:12:38 +02:00
Fix roll
This commit is contained in:
@@ -33,13 +33,9 @@ module.exports = class RollCommand extends Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
run(msg, { maxValue, minValue }) {
|
run(msg, { maxValue, minValue }) {
|
||||||
console.log(maxValue);
|
|
||||||
console.log(minValue);
|
|
||||||
let result;
|
let result;
|
||||||
if (minValue) result = randomRange(minValue, maxValue);
|
if (minValue) result = randomRange(minValue, maxValue);
|
||||||
else result = Math.floor(Math.random() * maxValue) + 1;
|
else result = Math.floor(Math.random() * maxValue) + 1;
|
||||||
console.log(result);
|
|
||||||
console.log(formatNumber(result));
|
|
||||||
return msg.say(`You rolled a ${formatNumber(result)}.`);
|
return msg.say(`You rolled a ${formatNumber(result)}.`);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ module.exports = class Argument {
|
|||||||
constructor(client, options) {
|
constructor(client, options) {
|
||||||
Object.defineProperty(this, 'client', { value: client });
|
Object.defineProperty(this, 'client', { value: client });
|
||||||
|
|
||||||
this.key = options.key.toLowerCase();
|
this.key = options.key;
|
||||||
this.label = typeof options.label === 'undefined' ? null : options.label;
|
this.label = typeof options.label === 'undefined' ? null : options.label;
|
||||||
this.typeID = options.type.toLowerCase();
|
this.typeID = options.type.toLowerCase();
|
||||||
this.min = typeof options.min === 'undefined' ? null : options.min;
|
this.min = typeof options.min === 'undefined' ? null : options.min;
|
||||||
|
|||||||
Reference in New Issue
Block a user