Skip to content

Commit f1253f9

Browse files
ivinjabrahamIvin
andauthored
Document rule for attachment names in embeds (#2959)
Co-authored-by: Ivin <[email protected]>
1 parent 85739d9 commit f1253f9

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/builder/create_embed.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,10 @@ impl CreateEmbed {
100100
self
101101
}
102102

103-
/// Set the image associated with the embed. This only supports HTTP(S).
103+
/// Set the image associated with the embed.
104+
///
105+
/// Refer [Discord Documentation](https://discord.com/developers/docs/reference#uploading-files)
106+
/// for rules on naming local attachments.
104107
#[inline]
105108
pub fn image(mut self, url: impl Into<String>) -> Self {
106109
self.0.image = Some(EmbedImage {
@@ -112,7 +115,7 @@ impl CreateEmbed {
112115
self
113116
}
114117

115-
/// Set the thumbnail of the embed. This only supports HTTP(S).
118+
/// Set the thumbnail of the embed.
116119
#[inline]
117120
pub fn thumbnail(mut self, url: impl Into<String>) -> Self {
118121
self.0.thumbnail = Some(EmbedThumbnail {
@@ -163,6 +166,8 @@ impl CreateEmbed {
163166
/// Note however, you have to be sure you set an attachment (with [`ChannelId::send_files`])
164167
/// with the provided filename. Or else this won't work.
165168
///
169+
/// Refer [`Self::image`] for rules on naming local attachments.
170+
///
166171
/// [`ChannelId::send_files`]: crate::model::id::ChannelId::send_files
167172
#[inline]
168173
pub fn attachment(self, filename: impl Into<String>) -> Self {
@@ -299,7 +304,9 @@ impl CreateEmbedFooter {
299304
self
300305
}
301306

302-
/// Set the icon URL's value. This only supports HTTP(S).
307+
/// Set the icon URL's value.
308+
///
309+
/// Refer [`CreateEmbed::image`] for rules on naming local attachments.
303310
pub fn icon_url(mut self, icon_url: impl Into<String>) -> Self {
304311
self.0.icon_url = Some(icon_url.into());
305312
self

0 commit comments

Comments
 (0)