I'm making a currency bot but I can't seem to figure out how to do something like: [prefix] deposit all/[prefix] withdraw all
or [prefix] deposit max/[prefix] withdraw max
but I can't seem to figure out how to do it. This is my code so far for deposit:
@client.command()
async def dep(ctx, amount=0):
users = await get_bank_data()
user = ctx.author
if amount > 0:
users[str(user.id)]['wallet'] -= amount
users[str(user.id)]['bank'] += amount
with open("mainbank.json", "w") as f:
json.dump(users, f)
await ctx.send(f"You have deposited {amount} coins!")
elif amount < 0:
await ctx.send(f"You can't deposit a negative amount of coins stupid!")
elif amount == 0:
await ctx.send(f"You can't deposit 0 coins stupid!")```
question from:https://stackoverflow.com/questions/65617624/trying-to-make-a-kind-of-pls-dep-all-or-pls-dep-max-kind-of-thing