join_chat()

Client.join_chat()

Join a group chat or channel.

Usable by Users Bots

Parameters:

chat_id (int | str) – Unique identifier for the target chat in form of a t.me/joinchat/ or t.me/<username> link, a username of the target channel/supergroup (in the format @username) or a chat id of a linked chat (channel or supergroup).

Returns:

Chat – On success, a chat object is returned.

Example

await app.join_chat("https://t.me/+AbCdEf0123456789")


await app.join_chat("pyrogram")


await app.join_chat(app.get_chat("pyrogram").linked_chat.id)