Struct tgbot::types::KeyboardButtonRequestChat
source · pub struct KeyboardButtonRequestChat { /* private fields */ }
Expand description
Represents a criteria used to request a suitable chat.
The identifier of the selected chat will be shared with the bot when the corresponding button is pressed.
Implementations§
source§impl KeyboardButtonRequestChat
impl KeyboardButtonRequestChat
sourcepub fn new(request_id: Integer, chat_is_channel: bool) -> Self
pub fn new(request_id: Integer, chat_is_channel: bool) -> Self
Creates a new KeyboardButtonRequestChat
.
§Arguments
request_id
- Signed 32-bit identifier of the request, which will be received back in thecrate::types::MessageDataChatShared
object; must be unique within the message.chat_is_channel
- Indicates whether to request a channel chat or a group/supergroup chat.
sourcepub fn with_bot_administrator_rights(
self,
value: ChatAdministratorRights
) -> Self
pub fn with_bot_administrator_rights( self, value: ChatAdministratorRights ) -> Self
Sets a new bot administrator rights.
§Arguments
value
- An 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.
sourcepub fn with_bot_is_member(self, value: bool) -> Self
pub fn with_bot_is_member(self, value: bool) -> Self
Sets a new value for a bot_is_member
flag.
§Arguments
value
- Indicates whether to request a chat with the bot as a member.
If not specified, no additional restrictions are applied.
sourcepub fn with_chat_is_created(self, value: bool) -> Self
pub fn with_chat_is_created(self, value: bool) -> Self
Sets a new value for a chat_is_created
flag.
§Arguments
value
- Indicates whether to request a chat owned by the user.
If not specified, no additional restrictions are applied.
sourcepub fn with_chat_is_forum(self, value: bool) -> Self
pub fn with_chat_is_forum(self, value: bool) -> Self
Sets a new value for a chat_is_forum
flag.
§Arguments
value
- Indicates whether to request a forum supergroup or a non-forum chat.
If not specified, no additional restrictions are applied.
sourcepub fn with_chat_has_username(self, value: bool) -> Self
pub fn with_chat_has_username(self, value: bool) -> Self
Sets a new value for a chat_has_username
flag.
§Arguments
value
- Indicates whether to request a supergroup or a channel with a username.
If not specified, no additional restrictions are applied.
sourcepub fn with_request_photo(self, value: bool) -> Self
pub fn with_request_photo(self, value: bool) -> Self
sourcepub fn with_request_title(self, value: bool) -> Self
pub fn with_request_title(self, value: bool) -> Self
sourcepub fn with_request_username(self, value: bool) -> Self
pub fn with_request_username(self, value: bool) -> Self
Sets a new value for a request_username
flag.
§Arguments
value
- Whether to request the chat’s username.
sourcepub fn with_user_administrator_rights(
self,
value: ChatAdministratorRights
) -> Self
pub fn with_user_administrator_rights( self, value: ChatAdministratorRights ) -> Self
Sets a new user administrator rights.
§Arguments
value
- An 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.
Trait Implementations§
source§impl Clone for KeyboardButtonRequestChat
impl Clone for KeyboardButtonRequestChat
source§fn clone(&self) -> KeyboardButtonRequestChat
fn clone(&self) -> KeyboardButtonRequestChat
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for KeyboardButtonRequestChat
impl Debug for KeyboardButtonRequestChat
source§impl<'de> Deserialize<'de> for KeyboardButtonRequestChat
impl<'de> Deserialize<'de> for KeyboardButtonRequestChat
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl PartialEq for KeyboardButtonRequestChat
impl PartialEq for KeyboardButtonRequestChat
source§fn eq(&self, other: &KeyboardButtonRequestChat) -> bool
fn eq(&self, other: &KeyboardButtonRequestChat) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for KeyboardButtonRequestChat
impl PartialOrd for KeyboardButtonRequestChat
source§fn partial_cmp(&self, other: &KeyboardButtonRequestChat) -> Option<Ordering>
fn partial_cmp(&self, other: &KeyboardButtonRequestChat) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more