1# public chat
2from telethon.tl.functions.channels import JoinChannelRequest
3await client(JoinChannelRequest(channel))
4
5# private chat
6from telethon.tl.functions.messages import ImportChatInviteRequest
7updates = await client(ImportChatInviteRequest('AAAAAEHbEkejzxUjAUCfYg'))
8