eco-bet: added a check for bet target's money
This commit is contained in:
parent
d6548c53db
commit
c71406a8d0
|
@ -42,6 +42,8 @@ export const BetCommand = new Command({
|
||||||
return channel.send("You must bet at least one Mon!");
|
return channel.send("You must bet at least one Mon!");
|
||||||
else if (sender.money < amount)
|
else if (sender.money < amount)
|
||||||
return channel.send("You don't have enough Mons for that.", getMoneyEmbed(author));
|
return channel.send("You don't have enough Mons for that.", getMoneyEmbed(author));
|
||||||
|
else if (receiver.money < amount)
|
||||||
|
return channel.send("They don't have enough Mons for that.", getMoneyEmbed(target));
|
||||||
|
|
||||||
return channel.send("How long until the bet ends?");
|
return channel.send("How long until the bet ends?");
|
||||||
}
|
}
|
||||||
|
@ -70,6 +72,8 @@ export const BetCommand = new Command({
|
||||||
return channel.send("You must bet at least one Mon!");
|
return channel.send("You must bet at least one Mon!");
|
||||||
else if (sender.money < amount)
|
else if (sender.money < amount)
|
||||||
return channel.send("You don't have enough Mons for that.", getMoneyEmbed(author));
|
return channel.send("You don't have enough Mons for that.", getMoneyEmbed(author));
|
||||||
|
else if (receiver.money < amount)
|
||||||
|
return channel.send("They don't have enough Mons for that.", getMoneyEmbed(target));
|
||||||
|
|
||||||
// handle invalid duration
|
// handle invalid duration
|
||||||
if (duration <= 0)
|
if (duration <= 0)
|
||||||
|
|
Loading…
Reference in New Issue