Skip to content

Commit

Permalink
Add CurrentApplicationInfo::store_url method
Browse files Browse the repository at this point in the history
  • Loading branch information
mkrasnitski committed Jul 11, 2024
1 parent b3f6195 commit 0678c3b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/model/application/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,17 @@ pub struct CurrentApplicationInfo {
std::collections::HashMap<InstallationContext, InstallationContextConfig>,
}

impl CurrentApplicationInfo {
/// Returns the store url for the application. If included in a message, will render as a rich
/// embed. See the [Discord docs] for details.
///
/// [Discord docs]: https://discord.com/developers/docs/monetization/managing-your-store#linking-to-your-store
#[must_use]
pub fn store_url(&self) -> String {
format!("https://discord.com/application-directory/{}/store", self.id)
}
}

#[cfg(feature = "unstable_discord_api")]
enum_number! {
/// An enum representing the [installation contexts].
Expand Down

0 comments on commit 0678c3b

Please sign in to comment.