Download plugins/callbacks.py from sahanind/ubot1: direct link, hf CLI and curl.
- Browser
- Download file 1.41 kB
-
https://huggingface.co/spaces/sahanind/ubot1/resolve/main/plugins/callbacks.py
- Command line
-
hf download hf://spaces/sahanind/ubot1/plugins/callbacks.py
-
curl -L -o callbacks.py https://huggingface.co/spaces/sahanind/ubot1/resolve/main/plugins/callbacks.py
1.41 kB
| """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 | |
| # Set up logging configuration | |
| logging.basicConfig( | |
| level=logging.DEBUG, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s" | |
| ) | |
| logger = logging.getLogger(__name__) | |
| 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, | |
| # disable_web_page_preview=True | |
| ) | |
| elif update.data == "help": | |
| await update.message.edit( | |
| text=Translation.HELP_TEXT, | |
| reply_markup=Translation.HELP_BUTTONS, | |
| # disable_web_page_preview=True | |
| ) | |
| elif update.data == "about": | |
| await update.message.edit( | |
| text=Translation.ABOUT_TEXT, | |
| reply_markup=Translation.ABOUT_BUTTONS, | |
| # disable_web_page_preview=True | |
| ) | |
| 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() | |