Catch discord error, make "all" match uppercase

This commit is contained in:
Stijn De Clercq 2021-05-16 12:15:45 +02:00
parent dc7e982491
commit f6d06eb489
4 changed files with 6 additions and 6 deletions

View file

@ -55,13 +55,13 @@ def isValidAmount(ctx, amount):
if not amount:
return [False, "Geef een geldig bedrag op."]
dinks = float(currency.dinks(ctx.author.id))
if amount == "all":
if str(amount).lower() == "all":
if dinks > 0:
return [True, dinks]
else:
return [False, "Je hebt niet genoeg Didier Dinks om dit te doen."]
# Check if it's a number <= 0 or text != all
if (all(char.isalpha() for char in str(amount)) and amount != "all") or \
if (all(char.isalpha() for char in str(amount)) and str(amount).lower() != "all") or \
(all(char.isdigit() for char in str(abs(int(amount)))) and int(amount) <= 0):
return [False, "Geef een geldig bedrag op."]
if int(amount) > dinks: