Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How do I know if user's message is a reply?

I am using telebot for Python.

Is there any way I get to know if the message is a reply?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

I assume you are using this library: https://pytba.readthedocs.io/en/latest/index.html

If you have a Message object r, you can check its reply_to_message attribute:

  • If reply_to_message is another Message instance m, r is a reply to m.

  • If reply_to_message is None, r is not a reply.

If you have a different library, it should work similarly, as it corresponds directly to the Telegram API.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading