Spaces:
Sleeping
Sleeping
| import random | |
| from hydrogram import filters | |
| from hydrogram.types import Message | |
| from bot import TelegramBot | |
| from bot.config import Telegram, PICS | |
| from bot.modules.static import * | |
| from bot.modules.decorators import verify_user | |
| async def start_command(_, msg: Message): | |
| # Randomly select a photo link from PICS | |
| pic = random.choice(PICS.split()) | |
| caption_text = random.choice(WelcomeText) % {'first_name': msg.from_user.first_name} | |
| try: | |
| await msg.reply_photo( | |
| photo=pic, | |
| caption=caption_text, | |
| quote=True | |
| ) | |
| except Exception: | |
| # If sending the photo fails, just send the text message. | |
| await msg.reply( | |
| text=caption_text, | |
| quote=True | |
| ) | |
| async def privacy_command(_, msg: Message): | |
| await msg.reply(text=PrivacyText, quote=True, disable_web_page_preview=True) | |
| async def log_command(_, msg: Message): | |
| await msg.reply_document('event-log.txt', quote=True) | |