KeyboardButtonRequestChat

class telegram.KeyboardButtonRequestChat(request_id, chat_is_channel, chat_is_forum=None, chat_has_username=None, chat_is_created=None, user_administrator_rights=None, bot_administrator_rights=None, bot_is_member=None, request_title=None, request_username=None, request_photo=None, *, api_kwargs=None)[source]

Bases: telegram.TelegramObject

This object defines the criteria used to request a suitable chat. The identifier of the selected user will be shared with the bot when the corresponding button is pressed. More about requesting users ».

Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their request_id is equal.

Added in version 20.1.

Parameters:
request_id[source]

Identifier of the request.

Type:

int

chat_is_channel[source]

Pass True to request a channel chat, pass False to request a group or a supergroup chat.

Type:

bool

chat_is_forum[source]

Optional. Pass True to request a forum supergroup, pass False to request a non-forum chat. If not specified, no additional restrictions are applied.

Type:

bool

chat_has_username[source]

Optional. Pass True to request a supergroup or a channel with a username, pass False to request a chat without a username. If not specified, no additional restrictions are applied.

Type:

bool

chat_is_created[source]

user. Otherwise, no additional restrictions are applied.

Type:

bool

user_administrator_rights[source]

required administrator rights of the user in the chat. If not specified, no additional restrictions are applied.

Type:

ChatAdministratorRights

bot_administrator_rights[source]

required administrator rights of the bot in the chat. The rights must be a subset of user_administrator_rights. If not specified, no additional restrictions are applied.

Type:

ChatAdministratorRights

bot_is_member[source]

as a member. Otherwise, no additional restrictions are applied.

Type:

bool

request_title[source]

Optional. Pass True to request the chat’s title.

Added in version 21.1.

Type:

bool

request_username[source]

Optional. Pass True to request the chat’s username.

Added in version 21.1.

Type:

bool

request_photo[source]

Optional. Pass True to request the chat’s photo.

Added in version 21.1.

Type:

bool

classmethod de_json(data, bot=None)[source]

See telegram.TelegramObject.de_json().