Getting chat_id with a link to a chat in the Telegram API

I use the Telegram API to develop a program for combining Telegram groups or channels by their links.

Methods that connect a group or channel (e.g. channel.joinChannel) need chat_idor channel_id, but I only have links to groups or channels (e.g. @channel_username or https://t.me/channel_username or https: // t. me / joinChat / xxxxx )

How can I get chat_ideither a channel_idgroup or a channel having a link?

PS: I am not the administrator of these groups or channels.

+6
source share
1 answer

I found the answer:

checkChatInvite. , chat_id.

joinChat. chat_id, , .

+6

Source: https://habr.com/ru/post/1016130/


All Articles