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.Available In
Added in version 20.1.
- Parameters:
request_id (
int
) – Signed 32-bit identifier of the request, which will be received back in thetelegram.ChatShared
object. Must be unique within the message.chat_is_channel (
bool
) – PassTrue
to request a channel chat, passFalse
to request a group or a supergroup chat.chat_is_forum (
bool
, optional) – PassTrue
to request a forum supergroup, passFalse
to request a non-forum chat. If not specified, no additional restrictions are applied.chat_has_username (
bool
, optional) – PassTrue
to request a supergroup or a channel with a username, passFalse
to request a chat without a username. If not specified, no additional restrictions are applied.chat_is_created (
bool
, optional) – PassTrue
to request a chat owned by the user. Otherwise, no additional restrictions are applied.user_administrator_rights (
ChatAdministratorRights
, optional) – Specifies the required administrator rights of the user in the chat. If not specified, no additional restrictions are applied.bot_administrator_rights (
ChatAdministratorRights
, optional) – Specifies the required administrator rights of the bot in the chat. The rights must be a subset ofuser_administrator_rights
. If not specified, no additional restrictions are applied.bot_is_member (
bool
, optional) – PassTrue
to request a chat with the bot as a member. Otherwise, no additional restrictions are applied.request_title (
bool
, optional) –Pass
True
to request the chat’s title.Added in version 21.1.
request_username (
bool
, optional) –Pass
True
to request the chat’s username.Added in version 21.1.
request_photo (
bool
, optional) –Pass
True
to request the chat’s photo.Added in version 21.1.
- chat_is_channel[source]¶
Pass
True
to request a channel chat, passFalse
to request a group or a supergroup chat.- Type:
- chat_is_forum[source]¶
Optional. Pass
True
to request a forum supergroup, passFalse
to request a non-forum chat. If not specified, no additional restrictions are applied.- Type:
- chat_has_username[source]¶
Optional. Pass
True
to request a supergroup or a channel with a username, passFalse
to request a chat without a username. If not specified, no additional restrictions are applied.- Type:
- user_administrator_rights[source]¶
required administrator rights of the user in the chat. If not specified, no additional restrictions are applied.
- Type:
- 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:
- request_title[source]¶
Optional. Pass
True
to request the chat’s title.Added in version 21.1.
- Type:
- request_username[source]¶
Optional. Pass
True
to request the chat’s username.Added in version 21.1.
- Type:
- request_photo[source]¶
Optional. Pass
True
to request the chat’s photo.Added in version 21.1.
- Type: