You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
create_option(name='id', description="The ID of the user you are donating to", option_type=3, required=True),
1029
+
create_option(name='amount', description="How much do you want to donate?", option_type=4, required=True)
1030
+
]
1031
+
)
1032
+
asyncdefdonate(ctx:SlashContext, id:str, amount):
1033
+
ifplugins.economy:
1034
+
reciever_info=client.get_user(int(id))
1035
+
ifidnotincurrency["wallet"]: returnawaitctx.reply("Unfortunately, we couldn't find that user in our server. Try double-checking the ID you've provided.", hidden=True)
1036
+
# Prevent self-donations
1037
+
ifid==ctx.author.id: returnawaitctx.reply("You can't donate to yourself stupid.", hidden=True)
1038
+
# Check for improper amount argument values
1039
+
ifamount<1: returnawaitctx.reply("The amount has to be greater than `1`!", hidden=True)
1040
+
elifamount>1000000000: returnawaitctx.reply("You can only donate less than 1 billion coins!", hidden=True)
1041
+
elifamount>currency["wallet"][str(ctx.author.id)]: returnawaitctx.reply("You're too poor to be donating that much money lmao")
1042
+
# If no improper values, proceed with donation
1043
+
try:
1044
+
currency["wallet"][str(id)] +=amount
1045
+
currency["wallet"][str(ctx.author.id)] -=amount
1046
+
save()
1047
+
exceptExceptionase: returnawaitctx.reply(e)
1048
+
localembed=discord.Embed(title="Donation Successful", description=f"You successfully donated {amount} coins to {reciever_info.name}!", color=discord.Color.green())
0 commit comments