Skip to content

Commit

Permalink
Update interaction.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
cheesycod authored Dec 2, 2024
1 parent d6b9b28 commit 76b0ca1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/model/application/interaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,17 @@ impl Interaction {
}
}

/// Guild ID the interaction was sent from, if any.
#[must_use]
pub fn guild_id(&self) -> Option<GuildId> {
match self {
Self::Ping(_) => None,
Self::Command(i) | Self::Autocomplete(i) => i.guild_id,
Self::Component(i) => i.guild_id,
Self::Modal(i) => i.guild_id,
}
}

/// Gets the interaction application Id
#[must_use]
pub fn application_id(&self) -> ApplicationId {
Expand Down

0 comments on commit 76b0ca1

Please sign in to comment.