简体   繁体   中英

Discord.PY not withdrawing

@client.command()
async def withdraw(ctx, change, amount = None):
    await open_account(ctx.author)

    if amount == None:
        await ctx.send("Please enter the amount")
        return

    bal = await update_bank(ctx.author, change)

    amount = int(amount)

    if amount>bal[1]:
        await ctx.send("You don't have enough money")
        return

    if amount<0:
        await ctx.send("YOU CAN'T WITHDRAW A NEGATIVE AMOUNT")
        return

    await update_bank(ctx.author,amount)
    await update_bank(ctx.author,-1*amount, "bank")

    await ctx.send(f"You deposited {amount} coins!")

Everytime I run "vb withdraw 100" all I get is "Please Enter Amount" which is weird do you guys know whats wrong and how we can fix it...

Simply delete the change arg

async def withdraw(ctx, amount = None):
   # ...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM