Spaces:
Running
Running
Create callback.py
Browse files- chatbot/plugins/callback.py +15 -0
chatbot/plugins/callback.py
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
from pyrogram import Client, filters
|
3 |
+
from pyrogram.types import *
|
4 |
+
|
5 |
+
@Client.on_pre_checkout_query()
|
6 |
+
async def pre_checkout_query_handler(client: Client, query: PreCheckoutQuery):
|
7 |
+
await query.answer(ok=True)
|
8 |
+
|
9 |
+
@Client.on_message(filters.successful_payment)
|
10 |
+
async def successful_payment_handler(client: Client, message: Message):
|
11 |
+
try:
|
12 |
+
await message.reply("Thank you for your support!")
|
13 |
+
# await client.refund_star_payment(message.from_user.id, message.successful_payment.telegram_payment_charge_id)
|
14 |
+
except:
|
15 |
+
await message.reply("ok nothing happen")
|