|
"""Module for handling Pyrogram callback queries""" |
|
|
|
import logging |
|
from pyrogram import Client |
|
from plugins.dl_button import ddl_call_back |
|
from plugins.button import youtube_dl_call_back |
|
from plugins.script import Translation |
|
|
|
|
|
logging.basicConfig( |
|
level=logging.DEBUG, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s" |
|
) |
|
logger = logging.getLogger(__name__) |
|
|
|
|
|
@Client.on_callback_query() |
|
async def button(bot, update): |
|
if update.data == "home": |
|
await update.message.edit( |
|
text=Translation.START_TEXT.format(update.from_user.mention), |
|
reply_markup=Translation.START_BUTTONS, |
|
|
|
) |
|
elif update.data == "help": |
|
await update.message.edit( |
|
text=Translation.HELP_TEXT, |
|
reply_markup=Translation.HELP_BUTTONS, |
|
|
|
) |
|
elif update.data == "about": |
|
await update.message.edit( |
|
text=Translation.ABOUT_TEXT, |
|
reply_markup=Translation.ABOUT_BUTTONS, |
|
|
|
) |
|
elif "close" in update.data: |
|
await update.message.delete(True) |
|
elif "|" in update.data: |
|
await youtube_dl_call_back(bot, update) |
|
elif "=" in update.data: |
|
await ddl_call_back(bot, update) |
|
else: |
|
await update.message.delete() |
|
|