join_chat()¶
- Client.join_chat(chat_id: int | str) ChatJoinResult¶
Adds the current user as a new member to a chat. Private and secret chats can’t be joined using this method.
Usable by ✅ Users ❌ Bots- Parameters:
chat_id (
int|str) – Unique identifier for the target chat in form of a t.me/joinchat/ link, a username of the target channel/supergroup (in the format @username) or a chat id of a linked chat (channel or supergroup).- Returns:
ChatJoinResult– On success, a chat join result object is returned.
Example
# Join chat via invite link await app.join_chat("https://t.me/+AbCdEf0123456789") # Join chat via username await app.join_chat("ftmgram") # Join a linked chat await app.join_chat((await app.get_chat("ftmgram")).linked_chat.id)