Obtaining chat_id having chat link in Telegram API
I found the answer:
First we must use checkChatInvite
method. It uses the chat link as input parameter and outputs the chat specifications includes chat_id
.
Then we use joinChat
method method. it uses the chat_id
got from the previous step and joins to that group or channel.