pub struct Answer<'a> { /* private fields */ }Expand description
Fluent builder returned by CallbackQuery::answer. Finalize with .send(&client).await.
Implementations§
Source§impl<'a> Answer<'a>
impl<'a> Answer<'a>
Sourcepub fn text<S: Into<String>>(self, text: S) -> Self
pub fn text<S: Into<String>>(self, text: S) -> Self
Show text as a toast notification (fades automatically).
Sourcepub fn alert<S: Into<String>>(self, text: S) -> Self
pub fn alert<S: Into<String>>(self, text: S) -> Self
Show text as a modal alert the user must dismiss.
Sourcepub fn url<S: Into<String>>(self, url: S) -> Self
pub fn url<S: Into<String>>(self, url: S) -> Self
Open url on the client (e.g. to launch a game).
Sourcepub fn cache_time(self, duration: Duration) -> Self
pub fn cache_time(self, duration: Duration) -> Self
Cache this answer for duration so repeated presses don’t reach the bot.
Auto Trait Implementations§
impl<'a> Freeze for Answer<'a>
impl<'a> RefUnwindSafe for Answer<'a>
impl<'a> Send for Answer<'a>
impl<'a> Sync for Answer<'a>
impl<'a> Unpin for Answer<'a>
impl<'a> UnsafeUnpin for Answer<'a>
impl<'a> UnwindSafe for Answer<'a>
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
Mutably borrows from an owned value. Read more