Skip to content

Commit

Permalink
Remove deprecated link_ensured method (#2898)
Browse files Browse the repository at this point in the history
  • Loading branch information
GnomedDev authored Jun 10, 2024
1 parent 3e03891 commit eb8495f
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions src/model/channel/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -588,15 +588,6 @@ impl Message {
self.id.link(self.channel_id, self.guild_id)
}

/// Same as [`Self::link`] but tries to find the [`GuildId`] if Discord does not provide it.
///
/// [`guild_id`]: Self::guild_id
#[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
}

/// Returns a builder which can be awaited to obtain a reaction or stream of reactions on this
/// message.
#[cfg(feature = "collector")]
Expand Down Expand Up @@ -963,27 +954,6 @@ impl MessageId {
format!("https://discord.com/channels/@me/{channel_id}/{self}")
}
}

/// 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,
channel_id: ChannelId,
mut guild_id: Option<GuildId>,
) -> String {
if guild_id.is_none() {
let found_channel = channel_id.to_channel(cache_http).await;

if let Ok(channel) = found_channel {
if let Some(c) = channel.guild() {
guild_id = Some(c.guild_id);
}
}
}

self.link(channel_id, guild_id)
}
}

#[cfg_attr(feature = "typesize", derive(typesize::derive::TypeSize))]
Expand Down

0 comments on commit eb8495f

Please sign in to comment.