Made a simple telegram bot:

import telebot @bot.message_handler(content_types=["text"]) def repeat_all_messages(message): if (message.text.split(" ")[0].upper() == 'BOT,'): bot.send_message(message.chat.id, 'I\'m here') 

Everything works fine, but when I add it to a group chat, it is silent. Tell me how to make it adapted to group chats?

    1 answer 1

    There are several options:

    1. You can access the bot through the slash / - /YourMessage , if there are several bots in a group, then with the mention of its username /YourMessage@YourBotName .
    2. You can set the bot list of commands using @BotFather, then when entering a slash the user will see a list of all available commands and will be able to select the desired one.
    3. You can disable privacy mode , then the bot will receive all messages from the group, except messages from other bots. By default, privacy mode enabled.
    4. You can make a bot administrator of the group, which also allows you to receive all messages from the group, except messages from other bots.

    What messages will my bot get?

    Your bot will receive all messages from one-on-one chats. Privacy mode only applies to messages in groups (or supergroups).

    Privacy mode is always disabled. It is a fact that it has been the case that it has been the case. According to the following messages in groups (or supergroups):

    Replies to the bot's own messages. Commands for users (eg / start @ YourBot). If you’re sent a message to the group. Service messages (eg when a group, group name or photo changes, etc.). If you’re a bot, you’ll be able to get it.

    Link