From c71406a8d081965667702d73032f72af98a268a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=83=95=E3=82=BA=E3=82=AD?= Date: Tue, 23 Feb 2021 23:25:28 +0100 Subject: [PATCH] eco-bet: added a check for bet target's money --- src/commands/fun/subcommands/eco-bet.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/commands/fun/subcommands/eco-bet.ts b/src/commands/fun/subcommands/eco-bet.ts index 556054c..edce702 100644 --- a/src/commands/fun/subcommands/eco-bet.ts +++ b/src/commands/fun/subcommands/eco-bet.ts @@ -42,6 +42,8 @@ export const BetCommand = new Command({ return channel.send("You must bet at least one Mon!"); else if (sender.money < amount) 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?"); } @@ -70,6 +72,8 @@ export const BetCommand = new Command({ return channel.send("You must bet at least one Mon!"); else if (sender.money < amount) 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 if (duration <= 0)