I’m having trouble with my Telegram bot in a group chat. It used to work fine when I mentioned it with @botname, but now it’s not responding to mentions anymore. The weird thing is, it still works perfectly with /commands.
I tried to figure out what’s going on. When I turn off privacy settings, the bot can see all messages. But that’s not really what I want.
I’m wondering if there’s been some kind of change on Telegram’s end. Does anyone know what might be causing this? Or how I can troubleshoot it?
Have you considered using webhooks instead of polling? I switched to webhooks a while back and it solved a lot of issues for me, including some weird behavior with mentions. It’s more efficient too, as Telegram pushes updates to your server directly.
To set it up, you’ll need a server with HTTPS. Then use the setWebhook method:
Make sure your server can handle POST requests. This approach eliminates the need for constant polling and might resolve your mention problem. Just a thought based on my experience. Let me know if you need more details on implementing webhooks.
I’ve encountered a similar issue with my Telegram bot recently. It turns out that Telegram made some changes to how bots handle mentions in group chats for privacy reasons. Now, bots can only see messages that specifically @mention them if they have the proper permissions set up.
To fix this, you need to enable the ‘can_be_mentioned’ permission for your bot. You can do this by sending a /setprivacy command to @BotFather and selecting ‘Disable’ for the privacy mode. This will allow your bot to see all messages that mention it, even in group chats.
Also, make sure you’re using the getUpdates method instead of fetchUpdates. The correct endpoint should be:
If you’re still having issues after trying these steps, you might want to check your bot’s webhook settings or consider implementing a webhook instead of polling for updates. Hope this helps!
yo ethan, i had the same prob with my bot. try checkin ur bot’s settings in @BotFather. sometimes the privacy mode gets messed up. also, make sure ur using the right API endpoint. it should be getUpdates, not fetchUpdates. if that dont work, maybe try restarting ur bot or regenerating the token. good luck man!