ImportChatInviteRequest

Only users can use this request. See code examples.

---functions---
messages.importChatInvite#de91436e hash:string = messages.ChatInviteJoinResult

Returns

messages.ChatInviteJoinResult

This type can be an instance of either:

ChatInviteJoinResultOkChatInviteJoinResultWebView

Parameters

hashstring

Known RPC errors

This request can cause 8 known errors:

ChannelsTooMuchErrorYou have joined too many channels/supergroups.
InviteHashEmptyErrorThe invite hash is empty.
InviteHashExpiredErrorThe chat the user tried to join has expired and is not valid anymore.
InviteHashInvalidErrorThe invite hash is invalid.
InviteRequestSentErrorYou have successfully requested to join this chat or channel.
SessionPasswordNeededErrorTwo-steps verification is enabled and a password is required.
UsersTooMuchErrorThe maximum number of users has been exceeded (to create a chat, for example).
UserAlreadyParticipantErrorThe authenticated user is already a participant of the chat.

You can import these from telethon.errors.

Example

from telethon.sync import TelegramClient
from telethon import functions, types

with TelegramClient(name, api_id, api_hash) as client:
    result = client(functions.messages.ImportChatInviteRequest(
        hash='A4LmkR23G0IGxBE71zZfo1'
    ))
    print(result.stringify())