conogram/entities/
keyboard_button_request_chat.rs

1use serde::{Deserialize, Serialize};
2
3use crate::{
4    entities::chat_administrator_rights::ChatAdministratorRights,
5    utils::deserialize_utils::is_false,
6};
7
8/// This object defines the criteria used to request a suitable chat. Information about the selected chat will be shared with the bot when the corresponding button is pressed. The bot will be granted requested rights in the chat if appropriate. [More about requesting chats ยป](https://core.telegram.org/bots/features#chat-and-user-selection).
9///
10/// API Reference: [link](https://core.telegram.org/bots/api/#keyboardbuttonrequestchat)
11#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
12pub struct KeyboardButtonRequestChat {
13    /// Signed 32-bit identifier of the request, which will be received back in the [ChatShared](https://core.telegram.org/bots/api/#chatshared) object. Must be unique within the message
14    pub request_id: i64,
15
16    /// Pass *True* to request a channel chat, pass *False* to request a group or a supergroup chat.
17    pub chat_is_channel: bool,
18
19    /// *Optional*. Pass *True* to request a forum supergroup, pass *False* to request a non-forum chat. If not specified, no additional restrictions are applied.
20    #[serde(default, skip_serializing_if = "is_false")]
21    pub chat_is_forum: bool,
22
23    /// *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.
24    #[serde(default, skip_serializing_if = "is_false")]
25    pub chat_has_username: bool,
26
27    /// *Optional*. Pass *True* to request a chat owned by the user. Otherwise, no additional restrictions are applied.
28    #[serde(default, skip_serializing_if = "is_false")]
29    pub chat_is_created: bool,
30
31    /// *Optional*. A JSON-serialized object listing the required administrator rights of the user in the chat. The rights must be a superset of *bot\_administrator\_rights*. If not specified, no additional restrictions are applied.
32    #[serde(default, skip_serializing_if = "Option::is_none")]
33    pub user_administrator_rights: Option<ChatAdministratorRights>,
34
35    /// *Optional*. A JSON-serialized object listing the 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.
36    #[serde(default, skip_serializing_if = "Option::is_none")]
37    pub bot_administrator_rights: Option<ChatAdministratorRights>,
38
39    /// *Optional*. Pass *True* to request a chat with the bot as a member. Otherwise, no additional restrictions are applied.
40    #[serde(default, skip_serializing_if = "is_false")]
41    pub bot_is_member: bool,
42
43    /// *Optional*. Pass *True* to request the chat's title
44    #[serde(default, skip_serializing_if = "is_false")]
45    pub request_title: bool,
46
47    /// *Optional*. Pass *True* to request the chat's username
48    #[serde(default, skip_serializing_if = "is_false")]
49    pub request_username: bool,
50
51    /// *Optional*. Pass *True* to request the chat's photo
52    #[serde(default, skip_serializing_if = "is_false")]
53    pub request_photo: bool,
54}
55
56// Divider: all content below this line will be preserved after code regen