How to add a bot to a Telegram Group?

I've been trying to add a bot to my Telegram group in Android Device but I am not able to do so. I tried @bot_name, /bot_name, but it doesn't work.

Is it possible to add a bot to the group or should I create a new bot using Telegram API (not bot API) so that I can add the contact number to the group?


Solution 1:

Edit: now there is yet an easier way to do this - when creating your group, just mention the full bot name (eg. @UniversalAgent1Bot) and it will list it as you type. Then you can just tap on it to add it.

Old answer:

  1. Create a new group from the menu. Don't add any bots yet
  2. Find the bot (for instance you can go to Contacts and search for it)
  3. Tap to open
  4. Tap the bot name on the top bar. Your page becomes like this: Telegram bot settings
  5. Now, tap the triple ... and you will get the Add to Group button: Adding the bot
  6. Now select your group and add the bot - and confirm the addition

Solution 2:

You have to use @BotFather, send it command: /setjoingroups There will be dialog like this:

YOU: /setjoingroups

BotFather: Choose a bot to change group membership settings.

YOU: @YourBot

BotFather: 'Enable' - bot can be added to groups. 'Disable' - block group invitations, the bot can't be added to groups. Current status is: DISABLED

YOU: Enable

BotFather: Success! The new status is: ENABLED.

After this you will see button "Add to Group" in your bot's profile.

Solution 3:

Another way :

change BOT_USER_NAME before use

https://telegram.me/BOT_USER_NAME?startgroup=true

Solution 4:

In my case the 2 steps worked:

  1. Added bot to a group as a regular member
  2. Made Bot an admin.

The second step was needed to let Bot respond and sent messages to Group chat.

The response event.postData.contents looked like this:

{
   "ok":true,
   "result":{
      "message_id":31,
      "from":{
         "id":1234567890,
         "is_bot":true,
         "first_name":"bot for custom alerts",
         "username":"mybotname1_bot"
      },
      "chat":{
         "id":-1234567890,
         "title":"group name",
         "type":"group",
         "all_members_are_administrators":true
      },
      "date":1624860599,
      "text":"hi"
   }
}

I needed to receive the chat id (negative number from response) to send messages to the group by Bot.