pub enum ButtonRequest {
Location,
Contact,
RequestChat(KeyboardButtonRequestChat),
RequestUsers(KeyboardButtonRequestUsers),
Poll(KeyboardButtonPollType),
WebApp(WebAppInfo),
}
Expand description
Request something from user, when a button is pressed.
See individual variants documentation for more info.
Variants§
Location
If this variant is used, the user’s current location will be sent when the button is pressed.
Note: this option will only work in Telegram versions released after 9 April, 2016. Older clients will display unsupported message.
Contact
If this variant is used, the user’s phone number will be sent as a contact when the button is pressed.
Note: this option will only work in Telegram versions released after 9 April, 2016. Older clients will display unsupported message.
RequestChat(KeyboardButtonRequestChat)
If this variant is used, pressing the button will open a list of
suitable chats. Tapping on a chat will send its identifier to the bot in
a chat_shared
service message.
RequestUsers(KeyboardButtonRequestUsers)
If specified, pressing the button will open a list of suitable users. Identifiers of selected users will be sent to the bot in a “users_shared” service message. Available in private chats only.
Poll(KeyboardButtonPollType)
If this variant is used, the user will be asked to create a poll and send it to the bot when the button is pressed.
Note: this option will only work in Telegram versions released after 23 January, 2020. Older clients will display unsupported message.
WebApp(WebAppInfo)
If this variant is used, the described Web App will be launched when the button is pressed. The Web App will be able to send a “web_app_data” service message.
Note: this option will only work in Telegram versions released after 16 April, 2022. Older clients will display unsupported message.
Trait Implementations§
Source§impl Clone for ButtonRequest
impl Clone for ButtonRequest
Source§fn clone(&self) -> ButtonRequest
fn clone(&self) -> ButtonRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ButtonRequest
impl Debug for ButtonRequest
Source§impl<'de> Deserialize<'de> for ButtonRequest
impl<'de> Deserialize<'de> for ButtonRequest
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 Hash for ButtonRequest
impl Hash for ButtonRequest
Source§impl PartialEq for ButtonRequest
impl PartialEq for ButtonRequest
Source§impl Serialize for ButtonRequest
impl Serialize for ButtonRequest
impl Eq for ButtonRequest
impl StructuralPartialEq for ButtonRequest
Auto Trait Implementations§
impl Freeze for ButtonRequest
impl RefUnwindSafe for ButtonRequest
impl Send for ButtonRequest
impl Sync for ButtonRequest
impl Unpin for ButtonRequest
impl UnwindSafe for ButtonRequest
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Erasable for T
impl<T> Erasable for 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