From f1253f959b03a56003b5be3bfd0c388be0f445f7 Mon Sep 17 00:00:00 2001 From: Ivin Date: Sun, 20 Oct 2024 18:29:30 +0530 Subject: [PATCH] Document rule for attachment names in embeds (#2959) Co-authored-by: Ivin --- src/builder/create_embed.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/builder/create_embed.rs b/src/builder/create_embed.rs index 663cec8bf79..9081f4d8227 100644 --- a/src/builder/create_embed.rs +++ b/src/builder/create_embed.rs @@ -100,7 +100,10 @@ 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. #[inline] pub fn image(mut self, url: impl Into) -> Self { self.0.image = Some(EmbedImage { @@ -112,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 { @@ -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 { @@ -299,7 +304,9 @@ 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 { self.0.icon_url = Some(icon_url.into()); self