In this tutorial, I will explain how you can add a Telegram chatbot to your Telegram group and automatically reply to messages in your group.
I will show you:
- How the chatbot can only reply when you mention it
- How the chatbot can respond to all messages in the group
P.S. In my Telegram Chatbots guide, I already explained how you can can create a chatbot (without using any code), so if you haven’t already seen that one, I highly recommend to read it 🙂
Let’s dive in!
Table of Contents
Create a Telegram Group
As already mentioned in the beginning, I created my own Telegram chatbot which can reply to simple questions such as “Can I order a pizza”:
So the first step we need to do, is create our own Telegram group.
If you are on a desktop, just install Telegram, click on the Pen icon in the top-left corner and select New group:
Here, you need to select the members you want to add (probably some friends/colleagues of yours), give a name to the group (for example “Bot Test”) and click on Create:
Add Telegram Chatbot to the group
Now we’ve created our Telegram group and we need to add our chatbot.
So, you can just go to your Telegram chatbot (mine is called “Pizza-DF-Bot”) and click on the Top Bar:
Then, you need to click on “More” and select Add to Group:
And select the Telegram group you want to add the chatbot to:
Only reply if you mention the Telegram Chatbot
Once you’ve added your Telegram chatbot to your Telegram group, and you mention it, you will probably see that the chatbot doesn’t automatically respond:
This is because the chatbot is not an admin of the group.
So, you need to click on the top bar of your Telegram group:
Click on Edit:
And then choose for Administrators:
Click on Add admin:
Select your chatbot:
And then give it all the rights it needs:
When you’ve done this, and you will ask a question and mention the chatbot again, you will see that it is responding now:
Let Telegram Bot respond to all messages in the group
Now, the chatbot is only responding when you mention it.
But what if you want the chatbot to respond to all messages in the group?
Then, we need to have a talk with the BotFather.
In Telegram, you need to search for “BotFather” and start a conversation with him:
The BotFather immediately gives you a list of commands that you can use to change the settings of your chatbot:
Now, you need to type “/setprivacy”, which is a command we can use to change the privacy settings in Telegram groups.
Then, you can select which bot you want to change:
Then, you will see that the privacy settings are set to Enable (by default), which means the bot only replies to commands and mentions. Now, if you just type in “Disable” or click on the button, you can disable this setting:
And if you go back to your Telegram group and say something (without mentioning the bot), you will see that the chatbot automatically responds:
Now It’s Your Turn
And that’s how you add a Telegram chatbot to your Telegram group.
Now I have a question for you:
Do you already use Telegram Bots in your Groups? And if not, why not?
Let me know by leaving a comment below!
Hi,
Thanks for information it was very helpful. Please help me how I can add bots to telegram chennel.
Thanks
Hey Raphael! Currently, there is not a way to add a bot to a Telegram channel, other than manually coding it…
Hi,
How to add a bot to a public telegram channel by manually coding it?
Hey Prabhat! I personally don’t have any experience with manually coding this, so I honestly do not know. I would just try a Google search and maybe you can find anything!
Is there a way to create a bot and send messages from a group which you are not the owner to your own group?
No, that is not possible. The bot needs to be the admin of the group.
Hi,
Is this possible to filter chat messages from a telegram group and only get notifications when a certain word matches in the chat for the group?
Hey Vin! Yes, you can. In the second chapter of my Telegram Chatbots guide, I explain on how you can do this.
HI! I created a bot with Activechat but when I put it in the group he doesn’t respond to messages or words that should trigger him. He does it in private chat though. I’ve done everything you said in the video but that still does not work. Help!!
Hey Chloe! Good question! This probably is because of ActiveChat itself, they do not provide that functionality with their platform. If I were you, I should contact ActiveChat and ask whether you can do this with their platform.
Hi.
How can I add like and dislike on my subject as a comment
Hey Emmanuel! What do you mean with a like and dislike? And I think as a comment you mean the message someone sends in a Telegram group?
Hi,
Almost same as Chloe above, no response in group but appears in the bot. Of course I’ve followed the steps. How to debug?
Thx.
Hey Paul! This is because with ActiveChat you cannot use Telegram chatbots in groups, they don’t provide that functionality with their platform.
Confused. Isn’t that tutorial teach us use in telegram group?
I’m with you. i follow exactly as in the tutorial but the bot did not respond in the group chat but appears in the bot. is this something to do with setting or functionality? @Joren your tutorial seems to work tho. any insight will be appreciated.
Hey Sai! Did you use ActiveChat to create your chatbot? If that’s the case, you cannot add your Telegram bot to a group, because ActiveChat does not provide that functionality. If you want a chatbot builder that is able to do this, I would recommend using Xenioo.
I’ve added @language_translator_bot to a private and made it an admin so that it can reply when I mention it.
Now I want it to respond to all messages. But when I talk to the BotFather and /setprivacy, he tells me “You don’t have any bots yet. Use the /newbot command to create a new bot first.”
I don’t want to create a new bot, I just want the existing bot to respond within my group.
What to do?
When you go to the Botfather and type “/mybots”, what do you get?
Great post!! Thanks for sharing this with us. Keep up!
Thank you, Jonathan!
Hi, I’m struggling with some thing. I use telegram bot cooperating with home assistant. HA sends me via telegram bot some notifications. But it can also work opposite way. I can set up HA receiving message from telegram bot (for example “/something”) to trigger some action. The first trouble is that Google Assistant can’t send a message on telegram to telegram bot, because it’s not possible to set telegram number for the telegram bot as common telegram user. So I tried to use IFTTT and created New group and also New channel in telegram and added my bot to those places (set bot as administrator). Well, I can say to Google assistent something and IFTTT succesfully sends set up text to both places – telegram group and telegram chat group as well. But it’s not enought. If I forward message from “New group” (or “New chat”) manualy to the telegram bot than everything works perfekt. So I have to solve resending messages from “New groups” or “New chat” to my bot automatically. But I don’t know how. Can you help me? Thank’s a lot Jarda
Wow, seems like an awesome setup you’ve thought out. Could you tell me which chatbot builder you used to create the integration between Google Assistant and Telegram? And what is IFTTT?
Thanks for helping us Sir. I have a problem. How can i share my personal Bot so that everyone can receive bot messagges? I create a group with bot admin permission, but not worked for me.
Thanks in advance
Hey Alex! What is exactly not working? And with what chatbot builder did you create your Telegram chatbot?
Hi, thanks for the awesome article!
I’m using @BardeenBot from Bardeen. Would I need to disable privacy settings so it can see all messages in group?
Hey Murali! Yes, you should do that!
Am having issues of adding bot as my admin 😔😔 when ever I click the make bot admin their response is “sorry you are not allowed to do this. Please I need help
Hey Emeke! Are you sure that you are the admin of the bot?
Hi
How i can add a bot who can let members send messages after they add 5 people to the group
Can someone help me
As far as my knowledge goes, this is currently not possible.
How to read a message in a Telegram channel using Telegraf?
Hello
I’m in a simple project, my bot checks what was posted on a telegram channel, I need to get the information and pass it on to other users, this tutorial works with groups, but it didn’t work for my channel.
How to give the bot permission to read channel messages?
Hey Jefté! I currently do not know any chatbot platform that can read messages from a Telegram channel and send it inside a Telegram group. One way you could try is by doing it via Make (formerly known as Integromat).
I have created an AI bot with botfather by integrating it with Activechat AI, I have getting the response fine as per the skills I have configured when I join bot 1to1. But as soon as I am adding it to my group as admin, it is not responding on its own, neither responding even while mentioning its username, any suggesting, please?
Hey Neha! Unfortunately, it is not possible to add a Telegram Bot (created with ActiveChat) to a Telegram Group. ActiveChat does not provide this feature.
Hi there, I created my chatbot using Xenioo and its working perfectly for my group chat to private messages I followed all your tutorials on creating chatbot from xenioo and it was excellent. The only thing that I’ve realized is that, its creating too much information’s , no filters when it comes to privacy from my users in the group chat. I wonder if there’s a way that my chat bot could automate a direct private message to the new users once they’ve joined my group chat? also figuring out how can my returning visitors/users can access My chatbot to be redirected as the private message once they enter the group chat. would love to hear more from you! thank you Bigtime!
Hey Jane! Unfortunately, this is not possible with Xenioo (or any other chatbot platform I have seen). Telegram Bots mainly work in the group themselves and it is not possible to send a private message if someone enters the group. It is only possible to send a message in the group when someone enters the group.