You can simply use the in
keyword to check if the amount arg is either max
or all
, to check if it's a digit use str.isdigit()
async def dep(ctx, amount: str):
if amount.lower() in ["max", "all"]:
# Deposit all the money here
elif amount.isdigit() and int(amount) > 0:
amount = int(amount)
# The `amount` variable is now a positive integer, deposit it here
You can do the withdraw command on the same basis
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…