aboutsummaryrefslogtreecommitdiff
path: root/src/model/channel
diff options
context:
space:
mode:
Diffstat (limited to 'src/model/channel')
-rw-r--r--src/model/channel/embed.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/model/channel/embed.rs b/src/model/channel/embed.rs
index 0db22ef..f46f0d3 100644
--- a/src/model/channel/embed.rs
+++ b/src/model/channel/embed.rs
@@ -68,6 +68,22 @@ impl Embed {
/// This should only be useful in conjunction with [`Webhook::execute`].
///
/// [`Webhook::execute`]: struct.Webhook.html
+ ///
+ /// # Examples
+ ///
+ /// Create an embed:
+ ///
+ /// ```rust,no_run
+ /// use serenity::model::Embed;
+ ///
+ /// let embed = Embed::fake(|e| e
+ /// .title("Embed title")
+ /// .description("Making a basic embed")
+ /// .field(|f| f
+ /// .name("A field")
+ /// .value("Has some content.")
+ /// .inline(false)));
+ /// ```
#[inline]
pub fn fake<F>(f: F) -> Value where F: FnOnce(CreateEmbed) -> CreateEmbed {
Value::Object(f(CreateEmbed::default()).0)