[][src]Struct serenity::model::channel::Embed

pub struct Embed {
    pub author: Option<EmbedAuthor>,
    pub colour: Colour,
    pub description: Option<String>,
    pub fields: Vec<EmbedField>,
    pub footer: Option<EmbedFooter>,
    pub image: Option<EmbedImage>,
    pub kind: String,
    pub provider: Option<EmbedProvider>,
    pub thumbnail: Option<EmbedThumbnail>,
    pub timestamp: Option<String>,
    pub title: Option<String>,
    pub url: Option<String>,
    pub video: Option<EmbedVideo>,
}

Represents a rich embed which allows using richer markdown, multiple fields and more. This was heavily inspired by slack's attachments.

You can include an attachment in your own message by a user or a bot, or in a webhook.

Note: Maximum amount of characters you can put is 256 in a field name, 1024 in a field value, and 2048 in a description.

Fields

Information about the author of the embed.

The colour code of the embed.

The description of the embed.

The maximum value for this field is 2048 unicode codepoints.

The array of fields.

The maximum number of fields is 25.

Footer information for the embed.

Image information of the embed.

The type of the embed. For embeds not generated by Discord's backend, this will always be "rich".

Provider information for the embed.

For example, if the embed kind is "video", the provider might contain information about YouTube.

Thumbnail information of the embed.

Timestamp information.

The title of the embed.

The URL of the embed.

The embed's video information.

This is present if the kind is "video".

Methods

impl Embed
[src]

Creates a fake Embed, giving back a serde_json map.

This should only be useful in conjunction with Webhook::execute.

Examples

Create an embed:

use serenity::model::channel::Embed;

let embed = Embed::fake(|e| e
    .title("Embed title")
    .description("Making a basic embed")
    .field("A field", "Has some content.", false));

Trait Implementations

impl From<Embed> for CreateEmbed
[src]

Converts the fields of an embed into the values for a new embed builder.

Some values - such as Proxy URLs - are not preserved.

impl Clone for Embed
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Embed
[src]

Formats the value using the given formatter. Read more

impl Serialize for Embed
[src]

Serialize this value into the given Serde serializer. Read more

impl<'de> Deserialize<'de> for Embed
[src]

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations

impl Send for Embed

impl Sync for Embed

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T> From for T
[src]

Performs the conversion.

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> Borrow for T where
    T: ?Sized
[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut for T where
    T: ?Sized
[src]

Mutably borrows from an owned value. Read more

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

🔬 This is a nightly-only experimental API. (get_type_id)

this method will likely be replaced by an associated static

Gets the TypeId of self. Read more

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> Erased for T

impl<T> Typeable for T where
    T: Any

Get the TypeId of this object.

impl<T> DebugAny for T where
    T: Any + Debug
[src]

impl<T> CloneAny for T where
    T: Clone + Any
[src]

impl<T> UnsafeAny for T where
    T: Any