From fd52983f87f46a0c9b68713d9073a577860dd37d Mon Sep 17 00:00:00 2001 From: Ivin Date: Tue, 27 Aug 2024 09:48:08 +0530 Subject: [PATCH 1/2] Document rule for attachment names for proper functioning in embeds --- src/builder/create_embed.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/builder/create_embed.rs b/src/builder/create_embed.rs index 663cec8bf79..ba9792b472b 100644 --- a/src/builder/create_embed.rs +++ b/src/builder/create_embed.rs @@ -101,6 +101,9 @@ impl CreateEmbed { } /// Set the image associated with the embed. This only supports HTTP(S). + /// + /// Refer [Discord Documentation](https://discord.com/developers/docs/reference#uploading-files) + /// for rules on naming local attachments. #[inline] pub fn image(mut self, url: impl Into) -> Self { self.0.image = Some(EmbedImage { @@ -163,6 +166,8 @@ impl CreateEmbed { /// Note however, you have to be sure you set an attachment (with [`ChannelId::send_files`]) /// with the provided filename. Or else this won't work. /// + /// Refer [`Self::image`] for rules on naming local attachments. + /// /// [`ChannelId::send_files`]: crate::model::id::ChannelId::send_files #[inline] pub fn attachment(self, filename: impl Into) -> Self { @@ -300,6 +305,8 @@ impl CreateEmbedFooter { } /// Set the icon URL's value. This only supports HTTP(S). + /// + /// Refer [`CreateEmbed::image`] for rules on naming local attachments. pub fn icon_url(mut self, icon_url: impl Into) -> Self { self.0.icon_url = Some(icon_url.into()); self From 956a478cb7b15571b93304ab555b2ea22db08369 Mon Sep 17 00:00:00 2001 From: Ivin Date: Thu, 29 Aug 2024 19:26:43 +0530 Subject: [PATCH 2/2] Remove incorrect documentation about HTTP(S) support --- src/builder/create_embed.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/builder/create_embed.rs b/src/builder/create_embed.rs index ba9792b472b..9081f4d8227 100644 --- a/src/builder/create_embed.rs +++ b/src/builder/create_embed.rs @@ -100,7 +100,7 @@ impl CreateEmbed { self } - /// Set the image associated with the embed. This only supports HTTP(S). + /// Set the image associated with the embed. /// /// Refer [Discord Documentation](https://discord.com/developers/docs/reference#uploading-files) /// for rules on naming local attachments. @@ -115,7 +115,7 @@ impl CreateEmbed { self } - /// Set the thumbnail of the embed. This only supports HTTP(S). + /// Set the thumbnail of the embed. #[inline] pub fn thumbnail(mut self, url: impl Into) -> Self { self.0.thumbnail = Some(EmbedThumbnail { @@ -304,7 +304,7 @@ impl CreateEmbedFooter { self } - /// Set the icon URL's value. This only supports HTTP(S). + /// Set the icon URL's value. /// /// Refer [`CreateEmbed::image`] for rules on naming local attachments. pub fn icon_url(mut self, icon_url: impl Into) -> Self {