How to add a bot to a Telegram Group?
Asked Answered
H

4

51

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?

Homogenous answered 20/5, 2016 at 4:45 Comment(0)
L
68

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
Lesslie answered 21/10, 2016 at 11:39 Comment(2)
This was by far the easiest way. But please make those screenshot inline. Thanks.Pilliwinks
The bot also needs to be allowed to be assigned in bots. See the answer: https://mcmap.net/q/345196/-how-to-add-a-bot-to-a-telegram-groupBulla
B
39

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.

Beghard answered 20/5, 2016 at 6:24 Comment(0)
C
6

Another way :

change BOT_USER_NAME before use

https://telegram.me/BOT_USER_NAME?startgroup=true
Cental answered 23/8, 2016 at 13:42 Comment(0)
L
3

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.

Logistician answered 28/6, 2021 at 6:16 Comment(1)
It is worth highlighting here, that if your bot only listens to commands there is no requirement for admin. Admin is only needed for reading normal messages.Nikolai

© 2022 - 2024 — McMap. All rights reserved.