@@ -152,6 +152,9 @@ async def parse_amount(ctx, amount, bank=False):
152
152
)
153
153
return await ctx .reply (embed = embed )
154
154
return econ * (float (amount .replace ("%" , "" )) / 100 )
155
+ elif amount .lower () in ["a" , "all" , "everything" , "max" ]:
156
+ amount = user ["economy" ]["bank" ]
157
+ return amount
155
158
elif "k" in amount .lower () or "thousand" in amount .lower ():
156
159
return 1000 * int (amount .replace ("k" , "" ).replace ("thousand" , "" ).replace (" " , "" ))
157
160
elif "m" in amount .lower () or "mil" in amount .lower () or "million" in amount .lower ():
@@ -528,8 +531,10 @@ async def richest(ctx):
528
531
@limiter (10 , on_ratelimited = lambda ctx , delay , * _1 , ** _2 : ctx .send (f"You're on cooldown! Please wait `{ round (delay , 2 )} s`!" ))
529
532
async def deposit (ctx , * , amount : str ):
530
533
if (await userdb .find_one ({"userid" : ctx .author .id })):
531
- amt = await parse_amount (ctx , amount , False )
534
+ amt = ( await parse_amount (ctx , amount , False ) )
532
535
if amt is None :
536
+ print (amt )
537
+ print (amount )
533
538
embed = voltage .SendableEmbed (
534
539
title = ctx .author .display_name ,
535
540
icon_url = ctx .author .display_avatar .url ,
@@ -538,6 +543,14 @@ async def deposit(ctx, *, amount: str):
538
543
)
539
544
await ctx .reply (embed = embed )
540
545
return
546
+ elif amt < 0 :
547
+ embed = voltage .SendableEmbed (
548
+ title = ctx .author .display_name ,
549
+ icon_url = ctx .author .display_avatar .url ,
550
+ description = "Please enter a valid amount!" ,
551
+ color = "#FF0000" ,
552
+ )
553
+ return await ctx .reply (embed = embed )
541
554
userdata = (await userdb .find_one ({"userid" : ctx .author .id }))["economy" ]["wallet" ]
542
555
if userdata > 0 :
543
556
if amt > userdata :
0 commit comments