Struct carapax::types::AnswerCallbackQuery
source · pub struct AnswerCallbackQuery { /* private fields */ }
Expand description
Sends an answer to a callback query sent from an inline keyboard.
The answer will be displayed to the user as a notification at the top of the chat screen or as an alert.
Alternatively, the user can be redirected to the specified Game URL.
For this option to work, you must first create a game for your bot via Bot Father and accept the terms.
Otherwise, you may use links like t.me/your_bot?start=XXX
that open your bot with a parameter.
Implementations§
source§impl AnswerCallbackQuery
impl AnswerCallbackQuery
sourcepub fn new<T>(callback_query_id: T) -> AnswerCallbackQuery
pub fn new<T>(callback_query_id: T) -> AnswerCallbackQuery
Creates a new AnswerCallbackQuery
.
§Arguments
callback_query_id
- Unique identifier of the query to be answered.
sourcepub fn with_cache_time(self, value: i64) -> AnswerCallbackQuery
pub fn with_cache_time(self, value: i64) -> AnswerCallbackQuery
Sets a new cache time.
§Arguments
value
- The maximum amount of time in seconds that the result of the callback query may be cached client-side; telegram apps will support caching starting in version 3.14; default - 0.
sourcepub fn with_show_alert(self, value: bool) -> AnswerCallbackQuery
pub fn with_show_alert(self, value: bool) -> AnswerCallbackQuery
Sets a new value for a short_alert
flag.
§Arguments
value
- An alert will be shown by the client instead of a notification at the top of the chat screen; default -false
.
sourcepub fn with_text<T>(self, value: T) -> AnswerCallbackQuery
pub fn with_text<T>(self, value: T) -> AnswerCallbackQuery
Sets a new text.
§Arguments
value
- Text of the notification; if not specified, nothing will be shown to the user; 0-200 characters.
sourcepub fn with_url<T>(self, value: T) -> AnswerCallbackQuery
pub fn with_url<T>(self, value: T) -> AnswerCallbackQuery
Sets a new URL.
§Arguments
value
- URL that will be opened by the user’s client.
If you have created a game and accepted the conditions via Bot Father, specify the URL that opens your game – note that this will only work if the query comes from a callback game button.
Otherwise, you may use links like t.me/your_bot?start=XXX
that open your bot with a parameter.
Trait Implementations§
source§impl Clone for AnswerCallbackQuery
impl Clone for AnswerCallbackQuery
source§fn clone(&self) -> AnswerCallbackQuery
fn clone(&self) -> AnswerCallbackQuery
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for AnswerCallbackQuery
impl Debug for AnswerCallbackQuery
source§impl Method for AnswerCallbackQuery
impl Method for AnswerCallbackQuery
source§impl Serialize for AnswerCallbackQuery
impl Serialize for AnswerCallbackQuery
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,
Auto Trait Implementations§
impl Freeze for AnswerCallbackQuery
impl RefUnwindSafe for AnswerCallbackQuery
impl Send for AnswerCallbackQuery
impl Sync for AnswerCallbackQuery
impl Unpin for AnswerCallbackQuery
impl UnwindSafe for AnswerCallbackQuery
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