mirror of
https://github.com/Xtao-Labs/iShotaBot.git
synced 2024-11-22 07:07:52 +00:00
feat: donate amount
This commit is contained in:
parent
148a393068
commit
10c43d0647
@ -9,12 +9,19 @@ from init import bot
|
|||||||
filters.incoming & filters.command(["donate", f"donate@{bot.me.username}"])
|
filters.incoming & filters.command(["donate", f"donate@{bot.me.username}"])
|
||||||
)
|
)
|
||||||
async def send_donate(_, message: Message):
|
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(
|
await bot.send_invoice(
|
||||||
message.chat.id,
|
message.chat.id,
|
||||||
title="Donate",
|
title="Donate",
|
||||||
description="Support me",
|
description="Support me",
|
||||||
currency="XTR",
|
currency="XTR",
|
||||||
prices=[LabeledPrice(label="Star", amount=10)],
|
prices=[LabeledPrice(label="Star", amount=amount)],
|
||||||
payload="stars"
|
payload="stars"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user