pub struct Answer<'a> { /* private fields */ }
Expand description
A callback query answer builder.
It will be executed once .await
-ed. Modifying it after polling it once will have no effect.
Implementations§
Source§impl<'a> Answer<'a>
impl<'a> Answer<'a>
Sourcepub fn text<T: Into<String>>(self, text: T) -> Self
pub fn text<T: Into<String>>(self, text: T) -> Self
Configure the answer’s text.
The text will be displayed as a toast message (small popup which does not interrupt the user and fades on its own after a short period of time).
Sourcepub fn cache_time(self, time: Duration) -> Self
pub fn cache_time(self, time: Duration) -> Self
For how long should the answer be considered valid. It will be cached by the client for the given duration, so subsequent callback queries with the same data will not reach the bot.
Sourcepub fn alert<T: Into<String>>(self, text: T) -> Self
pub fn alert<T: Into<String>>(self, text: T) -> Self
Configure the answer’s text.
The text will be displayed as an alert (popup modal window with the text, which the user needs to close before performing other actions).
Sourcepub async fn send(self) -> Result<(), InvocationError>
pub async fn send(self) -> Result<(), InvocationError>
Send the answer back to Telegram, and then relayed to the user who pressed the inline button.
Sourcepub async fn edit<M: Into<InputMessage>>(
self,
new_message: M,
) -> Result<(), InvocationError>
pub async fn edit<M: Into<InputMessage>>( self, new_message: M, ) -> Result<(), InvocationError>
Self::send
the answer, and also edit the message that contained the button.
Sourcepub async fn respond<M: Into<InputMessage>>(
self,
message: M,
) -> Result<Message, InvocationError>
pub async fn respond<M: Into<InputMessage>>( self, message: M, ) -> Result<Message, InvocationError>
Self::send
the answer, and also respond in the chat where the button was clicked.
Sourcepub async fn reply<M: Into<InputMessage>>(
self,
message: M,
) -> Result<Message, InvocationError>
pub async fn reply<M: Into<InputMessage>>( self, message: M, ) -> Result<Message, InvocationError>
Self::send
the answer, and also reply to the message that contained the button.