Struct carapax::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: i64, chat_is_channel: bool) -> KeyboardButtonRequestChat
pub fn new(request_id: i64, chat_is_channel: bool) -> KeyboardButtonRequestChat
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
) -> KeyboardButtonRequestChat
pub fn with_bot_administrator_rights( self, value: ChatAdministratorRights ) -> KeyboardButtonRequestChat
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) -> KeyboardButtonRequestChat
pub fn with_bot_is_member(self, value: bool) -> KeyboardButtonRequestChat
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) -> KeyboardButtonRequestChat
pub fn with_chat_is_created(self, value: bool) -> KeyboardButtonRequestChat
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) -> KeyboardButtonRequestChat
pub fn with_chat_is_forum(self, value: bool) -> KeyboardButtonRequestChat
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) -> KeyboardButtonRequestChat
pub fn with_chat_has_username(self, value: bool) -> KeyboardButtonRequestChat
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) -> KeyboardButtonRequestChat
pub fn with_request_photo(self, value: bool) -> KeyboardButtonRequestChat
sourcepub fn with_request_title(self, value: bool) -> KeyboardButtonRequestChat
pub fn with_request_title(self, value: bool) -> KeyboardButtonRequestChat
sourcepub fn with_request_username(self, value: bool) -> KeyboardButtonRequestChat
pub fn with_request_username(self, value: bool) -> KeyboardButtonRequestChat
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
) -> KeyboardButtonRequestChat
pub fn with_user_administrator_rights( self, value: ChatAdministratorRights ) -> KeyboardButtonRequestChat
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<KeyboardButtonRequestChat, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<KeyboardButtonRequestChat, <__D as Deserializer<'de>>::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 moresource§impl Serialize for KeyboardButtonRequestChat
impl Serialize for KeyboardButtonRequestChat
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl Copy for KeyboardButtonRequestChat
impl StructuralPartialEq for KeyboardButtonRequestChat
Auto Trait Implementations§
impl Freeze for KeyboardButtonRequestChat
impl RefUnwindSafe for KeyboardButtonRequestChat
impl Send for KeyboardButtonRequestChat
impl Sync for KeyboardButtonRequestChat
impl Unpin for KeyboardButtonRequestChat
impl UnwindSafe for KeyboardButtonRequestChat
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more