Spaces:
Runtime error
Runtime error
| # PATH: bot/handlers.py | |
| from hydrogram import Client, filters | |
| from hydrogram.types import Message | |
| from bot.config import Telegram | |
| def setup_handlers(app: Client) -> None: | |
| async def start_handler(_: Client, m: Message): | |
| await m.reply_text( | |
| "β Online.\n" | |
| "Commands:\n" | |
| "/ping\n" | |
| "/me\n" | |
| ) | |
| async def ping_handler(_: Client, m: Message): | |
| await m.reply_text("π Pong!") | |
| async def me_handler(_: Client, m: Message): | |
| uid = m.from_user.id if m.from_user else None | |
| await m.reply_text(f"π€ Your ID: `{uid}`", quote=True) | |
| async def echo_handler(_: Client, m: Message): | |
| # Normal simple reply bot | |
| txt = (m.text or "").strip() | |
| if not txt: | |
| return | |
| await m.reply_text(f"π£ You said: {txt}") |