telegram.ChatJoinRequest

class telegram.ChatJoinRequest(*args, **kwargs)[source]

Bases: telegram.TelegramObject

This object represents a join request sent to a chat.

Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their chat, from_user and date are equal.

Note

Since Bot API 5.5, bots are allowed to contact users who sent a join request to a chat where the bot is an administrator with the can_invite_users administrator right – even if the user never interacted with the bot before.

New in version 13.8.

Parameters
chat[source]

Chat to which the request was sent.

Type

telegram.Chat

from_user[source]

User that sent the join request.

Type

telegram.User

date[source]

Date the request was sent.

Type

datetime.datetime

bio[source]

Optional. Bio of the user.

Type

str

Optional. Chat invite link that was used by the user to send the join request.

Type

telegram.ChatInviteLink

async approve(*, read_timeout=None, write_timeout=None, connect_timeout=None, pool_timeout=None, api_kwargs=None)[source]

Shortcut for:

await bot.approve_chat_join_request(
    chat_id=update.effective_chat.id, user_id=update.effective_user.id, *args, **kwargs
)

For the documentation of the arguments, please see telegram.Bot.approve_chat_join_request().

Returns

On success, True is returned.

Return type

bool

classmethod de_json(data, bot)[source]

See telegram.TelegramObject.de_json().

async decline(*, read_timeout=None, write_timeout=None, connect_timeout=None, pool_timeout=None, api_kwargs=None)[source]

Shortcut for:

await bot.decline_chat_join_request(
    chat_id=update.effective_chat.id, user_id=update.effective_user.id, *args, **kwargs
)

For the documentation of the arguments, please see telegram.Bot.decline_chat_join_request().

Returns

On success, True is returned.

Return type

bool

to_dict()[source]

See telegram.TelegramObject.to_dict().