join_chat()

Client.join_chat()

Join a group chat or channel.

Parameters

chat_id (str) – Unique identifier for the target chat in form of a t.me/joinchat/ link or username of the target channel/supergroup (in the format @username).

Returns

Chat – On success, a chat object is returned.

Example

# Join chat via username
app.join_chat("pyrogram")

# Join chat via invite link
app.join_chat("https://t.me/joinchat/AAAAAE0QmSW3IUmm3UFR7A")