telethon invite to group

# public chat
from telethon.tl.functions.channels import JoinChannelRequest
await client(JoinChannelRequest(channel))

# private chat
from telethon.tl.functions.messages import ImportChatInviteRequest
updates = await client(ImportChatInviteRequest('AAAAAEHbEkejzxUjAUCfYg'))

Here is what the above code is Doing:
1. Importing the required functions from the telethon.tl.functions module.
2. Calling the function with the client.
3. Awaiting the result.

The result is an Updates object, which is a list of updates.