question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

reply_to_message property absent in group chats

See original GitHub issue

When replying to a message, the message object should look something like this:

{ message_id: 35,
  from: 
   { id: 37254959,
     first_name: 'Tom',
     last_name: 'Hansen',
     username: 'tomhansen' },
  chat: 
   { id: 37254959,
     first_name: 'Tom',
     last_name: 'Hansen',
     username: 'tomhansen',
     type: 'private' },
  date: 1453832286,
  reply_to_message: 
   { message_id: 17,
     from: 
      { id: 37254959,
        first_name: 'Hans',
        last_name: 'Tomsen',
        username: 'hanstomsen' },
     chat: 
      { id: 37254959,
        first_name: 'Tom',
        last_name: 'Hansen',
        username: 'tomhansen',
        type: 'private' },
     date: 1453829963,
     text: 'Hello.' },
  text: '/cmd1' }

The object above contains the reply_to_message property, because the message replies to another message. This works as expected when in a private chat, but not when in a group chat.

In a group chat the reply_to_message property is absent, even though the message replies to another message:

{ message_id: 35,
  from: 
   { id: 37254959,
     first_name: 'Tom',
     last_name: 'Hansen',
     username: 'tomhansen' },
  chat: { id: -25291336, title: 'Group title', type: 'group' }
  date: 1453832286,
  text: '/cmd1' }

Is there a reason for this?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

11reactions
ts95commented, Jan 31, 2016

For future reference I’d like to inform other users that might have the same problem. The reason for the absence of the reply_to_message property was that the bot was in privacy mode. All Telegram bots are in privacy mode by default, which limits them from receiving certain messages. More about that here. When I disabled this mode through the BotFather user, the reply_to_message property became present for all messages, which solved my problem.

0reactions
fiatjafcommented, Oct 2, 2019

That’s not correct. According to Telegram docs bots should get the reply_to_message when users are replying to bot messages but that doesn’t happen for me. However it does get the reply_to_message when users are replying to other messages using a bot command. All this in privacy mode.

The first case (users replying to bot messages) also doesn’t include a reply_to_message not even when the bot is a group admin (which means the bot gets all the messages) nor in a private conversation between the user and the bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Telegram bot doesn't respond to message in group rather ...
Telegram bot using node js doesn't reply in the group. When I text it in the group, it replies to me immediately in...
Read more >
API Reference - Discord.py
Read-only list of messages the connected client has cached. New in version 1.1. Type. Sequence[ Message ]. property ...
Read more >
iPhone 12 not getting group texts - Apple Support Communities
Just got the iphone 12 and i have a group of 8 ppl in a message. I realized that some messages are not...
Read more >
Reply to a specific message in chat - Microsoft Support
Reply to a specific message in chat in Teams. Go to a message and select More options > Reply.
Read more >
Voice Texting | Mopar
While Voice Text Reply provides 18 pre-formatted messages you ... December 2013 | Uconnect is a trademark of Chrysler Group LLC.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found