mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-21 14:04:38 +02:00
Fixes
This commit is contained in:
@@ -47,12 +47,9 @@ module.exports = class RouletteCommand extends Command {
|
||||
}
|
||||
|
||||
verifyWin(choice, result) {
|
||||
const number = parseInt(choice, 10);
|
||||
if (numbers.includes(number)) return result === number;
|
||||
if (!result) return false;
|
||||
if (dozens.includes(choice) || halves.includes(choice)) {
|
||||
const range = choice.split('-');
|
||||
return result >= range[0] && range[1] <= result;
|
||||
return result >= range[0] && range[1] >= result;
|
||||
}
|
||||
if (colors.includes(choice)) {
|
||||
if (choice === 'black') return black.includes(result);
|
||||
@@ -60,6 +57,9 @@ module.exports = class RouletteCommand extends Command {
|
||||
}
|
||||
if (parity.includes(choice)) return parity[result % 2] === choice;
|
||||
if (columns.includes(choice)) return columns[(result - 1) % 3] === choice;
|
||||
const number = parseInt(choice, 10);
|
||||
if (numbers.includes(number)) return result === number;
|
||||
if (!result) return false;
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user