eternnoir / pyTelegramBotAPI

Python Telegram bot api.
GNU General Public License v2.0
8.11k stars 2.03k forks source link

Bot handle commands for other bots in group chats #292

Closed ghost closed 7 years ago

ghost commented 7 years ago

image

  1. What version of pyTelegramBotAPI are you using? 2.3.0 from pip

  2. What OS are you using? heroku hosting

  3. What version of python are you using? 3.6.0

My /help command handler code

@bot.message_handler(commands=['start', 'help'], func=in_whitelist)
def start(msg):
    bot.send_message(msg.chat.id, r"""Привет!
Это кошерный самописный бот.
Не ругайтесь на него.""")

Privacy mode (https://core.telegram.org/bots#privacy-mode) is disabled

eternnoir commented 7 years ago

When privacy mode disabled bot will receive all message. So these two message are apply commands rule. A workaround is check text contain bot name.