Message link parser

The Telegram message link format holds the chat ID and the message ID. Paste a link like t.me/c/1234567890/45 or t.me/name/45 and this parser splits it into chat_id, message_id and topic ID for the Bot API, decoded in your browser.

Link → IDs

Paste a link to a message. Private links (t.me/c/…) are decoded here; nothing is sent.

IDs → link

Build the link to a message from what your bot received.

How the link is built

Private chatt.me/c/<channel>/<message>chat_id = −100 followed by <channel>
Forum topict.me/c/<channel>/<topic>/<message><topic> is message_thread_id
Public chatt.me/<username>/<message>chat_id = @username (or look the number up)

Use it

Copy a message into another chat with the values from the link:

curl -s "https://api.telegram.org/bot$TOKEN/copyMessage" \
  -d chat_id=<target chat> \
  -d from_chat_id=-1001234567890 \
  -d message_id=45

The shapes a message link can take

  • t.me/name/45: a message in a public channel or group with the username name. The chat is named, not numbered; use the lookup to get its chat_id.
  • t.me/c/1234567890/45: a message in a private channel or supergroup. The first number is the chat’s own ID; put -100 in front for the Bot API.
  • t.me/c/1234567890/7/45 or t.me/name/7/45: a message in forum topic 7, which is the message_thread_id.
  • ?comment=12 or ?thread=… at the end: a comment in a channel’s discussion group.

A worked example

Right-click a message in a private supergroup and copy its link: t.me/c/1987654321/3/120. The parser gives chat_id -1001987654321, topic 3 and message_id 120. A bot that is a member of that group can now reply in the topic with sendMessage, using message_thread_id: 3 and reply_parameters with message 120.

Why a link opens for you and not for others

A t.me/c/ link only opens for accounts that are members of the chat. It identifies the message, it does not give access to it. Basic groups and private chats have no message links at all.

FAQ

How do I get the chat ID from a t.me/c link?

Take the first number after /c/ and write −100 in front of it. t.me/c/1234567890/45 is chat_id −1001234567890, message_id 45.

What are the three numbers in t.me/c/123/7/45?

The channel's ID, the topic (message_thread_id) and the message ID. Links with two numbers after the chat belong to forum topics or comment threads.

Why does my private message link not open?

t.me/c/… links only open for accounts that are members of that chat. They also exist only for channels and supergroups; basic groups and private chats have no message links.

Can I use the link's numbers with copyMessage or forwardMessage?

Yes. Pass the chat_id (with −100) as from_chat_id and the last number as message_id. The bot must be a member of the source chat.

How do I copy a Telegram message link?

In the desktop and mobile apps, long-press or right-click the message and choose Copy Message Link. It exists for channels and supergroups only.