1

I've created a telegram bot and have many messages in the chat, I want to programmatically scroll to a certain message inside the chat, for example I want to have a link deep linked to a message in the chat so when I click on the link I would see the message in the chat but for some reason it's not working. Lookhing through the documentation this should do the trick

t.me/c/chat_id/message_id

Or

tg://openmessage?user_id=xxxchat_id=xxx&message_id=xxx

Unfortunately none of these work for me, does any one know what I'm doing wrong?

lupaulus
  • 358
  • 5
  • 22
Farzan
  • 607
  • 1
  • 8
  • 27
  • I found the documentation you were referring to: https://github.com/LonamiWebs/Telethon/wiki/Special-links Here is a working example: https://t.me/tgbeta/3539 Perhaps it is the ID's you use that are incorrect? Please give us some insight in how you determine the chat and message ID's. :) – estherwn May 13 '20 at 11:27

1 Answers1

3

The t.me/c format can only be used to link to a channel post, try the following steps to 'create a link';

  1. Create new Channel
  2. 'Post' a message
  3. Right click on the message -> 'Copy Post Link'

This will give you the following link: https://t.me/<channel_name>/<message_id>

This 'linking' does not work for private chats/groups. The only way I've managed to link to such a sort message is by sending a requglar sendMessage() with a reply_to_message_id_ so you can press that message, and telegram will show the 'quoted' message!

0stone0
  • 34,288
  • 4
  • 39
  • 64
  • this is a nice workaround. thanks for this method, i'll use it for our bot that sends messages and lets people to mark attendance to events by using inline buttons. the only way to view a list of all events would be to send a message "replying_to" each one of the board messages with the rota. – zavr Oct 17 '20 at 02:22