Link message by message_id via telegram bot
Asked Answered
F

1

6

I'm writing a simple bot and I want to basically link together two messages. I found that I could link one by replying on it, so it works like a charm. But now I want to insert a link to another message. And here is a problem, the only way to make a link I found is post link like https://t.me/{chat_name}/{message_id}. But it doesn't work for chats that don't have chat_name.

How could it be done?

Funk answered 27/6, 2018 at 14:32 Comment(6)
There have no solution so far :(Structuralism
How about forwarding the message?Labrum
@AlanBirtles bot shouldn't spam so I see it like [reply to a message] this message looks just like [link to another message]Funk
Have you found a solution or a workaround yet? @AlexZhukovskiyFamily
@Family if your chat is public then you could use t.me workaround. If it's not, then you can't refer it.Funk
In some chats you can also link to a message with t.me/c/chat_id/message_id , but it seems this is also possible only in public chatsConiferous
N
11

Usually worked this pattern: https://t.me/c/{chat_id}/{message_id}, but it worked for me when I sliced chat_id (skipping minus and first 3 digits). For example on JS: message.chat.id.toString().slice(4).

So, for message with chat_id: -1001473943182 and message_id: 5 link would be: https://t.me/c/1473943182/5.

But it work only for chat.type = 'supergroup' as I see and chat must have join link probably.

No answered 17/9, 2020 at 19:14 Comment(3)
Sounds weird, but I'd try it. ThanksFunk
@MrModest, thank you, it works. Idk what exactly makes a group a supergroup but I guess it's having more than one admin with a whole lot of rights.Lichenin
@Lichenin for supergroup you need to change one or more default permission for all users, for example "Change group info", as I nowNo

© 2022 - 2024 — McMap. All rights reserved.