Hey everyone! I’m trying to figure out if there’s a way for a Telegram Bot to send messages that only specific people in a group chat can see. I’m thinking about something like a ‘whisper’ feature.
Here’s what I’m hoping to do:
Use a bot command in the group chat
Have the bot respond, but only I can see the response
Other group members wouldn’t see my command or the bot’s reply
Is this even possible with Telegram Bots? Has anyone tried something similar or know if there’s a workaround? I think it would be super useful for certain types of group interactions or games.
Any ideas or suggestions would be really helpful. Thanks in advance!
As someone who’s built several Telegram bots, I can confirm that private messages within group chats aren’t possible with the current API. Bots can only send messages visible to all members or reply privately to the command sender. One potential workaround is to use a code system. Have users send commands with a unique code, like ‘/whisper 1234 message’. The bot could then DM all relevant users with coded messages. Only those with the right code would understand the context. This isn’t perfect, as savvy users might notice patterns. But it could work for simple applications where you need selective visibility. Just be aware it adds complexity and potential for confusion.
I’ve actually experimented with something similar for a Telegram-based RPG game I was developing. Unfortunately, Telegram’s API doesn’t support selective visibility for bot messages in group chats. The closest workaround I found was having the bot send a private message to the user who triggered the command. It’s not ideal, but it maintains some level of privacy.
Another option you might consider is using inline keyboards. While everyone can see the message, only the person who invoked the command can interact with the buttons. This could work for certain scenarios where you need limited interaction.
If you absolutely need the ‘whisper’ functionality, you might have to look into developing a custom client. But that’s a whole different ballgame and probably overkill for most use cases.
nah, tele bots cant do private msgs in groups. they reply publicly to everyone. but u could make the bot DM u privately when u use a command in the group. not exactly what u want, but might work for ur idea. goodluck man