Skip to content

Commit

Permalink
Add support for sending attachments in embeds (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
arqunis authored Jun 28, 2017
1 parent 3db42c9 commit c68d4d5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/builder/create_embed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,16 @@ impl CreateEmbed {

CreateEmbed(self.0)
}

/// Same as calling [`image`] with "attachment://filename.(jpg, png)".
///
/// 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.
///
/// [`ChannelId::send_files`]: ../model/struct.ChannelId.html#send_files
pub fn attachment(self, filename: &str) -> Self {
self.image(&format!("attachment://{}", filename))
}
}

impl Default for CreateEmbed {
Expand Down

0 comments on commit c68d4d5

Please sign in to comment.