mirror of
https://github.com/stijndcl/didier.git
synced 2026-04-07 15:48:29 +02:00
Catch discord error, make "all" match uppercase
This commit is contained in:
parent
dc7e982491
commit
f6d06eb489
4 changed files with 6 additions and 6 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue