From 0678c3baf4edb66ead7122bc17f95f55251f8632 Mon Sep 17 00:00:00 2001 From: Michael Krasnitski Date: Wed, 10 Jul 2024 19:29:54 -0400 Subject: [PATCH] Add `CurrentApplicationInfo::store_url` method --- src/model/application/mod.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/model/application/mod.rs b/src/model/application/mod.rs index 7750c478b66..6754212895e 100644 --- a/src/model/application/mod.rs +++ b/src/model/application/mod.rs @@ -82,6 +82,17 @@ pub struct CurrentApplicationInfo { std::collections::HashMap, } +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].