Использовать целые числа вместо чисел с точной

This commit is contained in:
JonnyBro 2022-01-19 18:37:54 +05:00
parent e51e045946
commit c5a3cff09e

View file

@ -8,7 +8,7 @@ class Horserace extends Command {
name: "horserace", name: "horserace",
dirname: __dirname, dirname: __dirname,
enabled: false, enabled: false,
guildOnly: false, guildOnly: true,
aliases: ["hr"], aliases: ["hr"],
memberPermissions: [], memberPermissions: [],
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"], botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
@ -57,9 +57,9 @@ class Horserace extends Command {
}); });
} }
} else if (args[0] === "bet") { } else if (args[0] === "bet") {
const horse = parseFloat(args[1]); const horse = parseInt(args[1]);
if (horse > 5) return message.sendT("fun/horserace:HORSE_NUM"); if (horse > 5) return message.sendT("fun/horserace:HORSE_NUM");
const amount = parseFloat(args[2]); const amount = parseInt(args[2]);
if (!amount || isNaN(amount) || parseInt(amount, 10) <= 0) return message.error("economy/pay:INVALID_AMOUNT"); if (!amount || isNaN(amount) || parseInt(amount, 10) <= 0) return message.error("economy/pay:INVALID_AMOUNT");
if (amount > data.memberData.money) return message.error("economy/pay:ENOUGH_MONEY", { if (amount > data.memberData.money) return message.error("economy/pay:ENOUGH_MONEY", {