soome changes
This commit is contained in:
18
app/bot/routers/channel.py
Normal file
18
app/bot/routers/channel.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# 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))
|
||||
Reference in New Issue
Block a user