Skip to content

Commit

Permalink
Add func to check if the callback was from an inline message
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrielFR committed Nov 5, 2024
1 parent bf09e24 commit c8e0061
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/grammers-client/src/types/callback_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ impl CallbackQuery {
self.raw.data.as_deref().unwrap()
}

/// Whether the callback query was generated from an inline message.
pub fn is_from_inline(&self) -> bool {
self.inline_msg_id.is_some()
}

/// Load the `Message` that contains the pressed inline button.
pub async fn load_message(&self) -> Result<types::Message, InvocationError> {
Ok(self
Expand Down

0 comments on commit c8e0061

Please sign in to comment.