Skip to content

Commit

Permalink
protected against negative betting
Browse files Browse the repository at this point in the history
  • Loading branch information
tkoppop committed Jun 18, 2021
1 parent d98e43b commit e546e6b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cogs/economy.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ async def coinflip(self, ctx: commands.Context, choice:int, amount:int):
"""Coinflip function, enter 0 for heads 1 for tails"""
with model.User(ctx.author).open_economy() as data:
if((choice == 0) | (choice == 1)):
if data["money"]>= amount & amount > 0:
if (data["money"]>= amount) & (amount > 0):
value = randint(0,1)
if value == 0:
await ctx.send(embed=core.bot_msg(f"it was heads"))
Expand Down

0 comments on commit e546e6b

Please sign in to comment.