Skip to content

Commit

Permalink
Deprecate MessageId::link_ensured (#2894)
Browse files Browse the repository at this point in the history
This is has a very niche use-case (getting the link to a message that
you have fetched via HTTP) that requires a HTTP request and can easily
be implemented in the user's code.
  • Loading branch information
GnomedDev authored Jun 8, 2024
1 parent a15e68e commit 9f9e4b3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/model/channel/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -819,6 +819,8 @@ impl Message {
///
/// [`guild_id`]: Self::guild_id
#[inline]
#[allow(deprecated)]
#[deprecated = "Use Self::link if Message was recieved via an event, otherwise use MessageId::link to provide the guild_id yourself."]
pub async fn link_ensured(&self, cache_http: impl CacheHttp) -> String {
self.id.link_ensured(cache_http, self.channel_id, self.guild_id).await
}
Expand Down Expand Up @@ -1197,6 +1199,7 @@ impl MessageId {
}

/// Same as [`Self::link`] but tries to find the [`GuildId`] if it is not provided.
#[deprecated = "Use GuildChannel::guild_id if you have no GuildId"]
pub async fn link_ensured(
&self,
cache_http: impl CacheHttp,
Expand Down

0 comments on commit 9f9e4b3

Please sign in to comment.