19 lines
847 B
Python
19 lines
847 B
Python
# app/bot/routers/channel.py
|
||
from telegram.ext import CommandHandler, filters
|
||
|
||
async def channel_redirect(update, ctx):
|
||
try:
|
||
await update.effective_message.reply_text(
|
||
"⚠️ В канале команды не поддерживаются. "
|
||
"Откройте ЛС со мной и выполните:\n"
|
||
"• /bind @username (или -100…)\n"
|
||
"• или /add_group и перешлите сюда пост из канала.",
|
||
disable_web_page_preview=True
|
||
)
|
||
except Exception:
|
||
pass
|
||
|
||
def register_channel_handlers(app):
|
||
# В канале любые «команды настроек» переводим в ЛС
|
||
app.add_handler(CommandHandler(["start","settings","security","dicts","spam_import"], channel_redirect, filters.ChatType.CHANNEL))
|