From 10c43d0647fb3098e8441d9663bbe2c60b8a7c94 Mon Sep 17 00:00:00 2001 From: xtaodada Date: Fri, 7 Jun 2024 23:50:35 +0800 Subject: [PATCH] feat: donate amount --- modules/donate.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/donate.py b/modules/donate.py index 07f2843..33d2e8e 100644 --- a/modules/donate.py +++ b/modules/donate.py @@ -9,12 +9,19 @@ from init import bot filters.incoming & filters.command(["donate", f"donate@{bot.me.username}"]) ) async def send_donate(_, message: Message): + amount = 10 + try: + amount = int(message.command[1]) + except Exception: + pass + if amount < 1 or amount > 1000: + amount = 10 await bot.send_invoice( message.chat.id, title="Donate", description="Support me", currency="XTR", - prices=[LabeledPrice(label="Star", amount=10)], + prices=[LabeledPrice(label="Star", amount=amount)], payload="stars" )