Struct serenity::utils::builder::CreateEmbed [] [src]

pub struct CreateEmbed(pub BTreeMap<String, Value>);

A builder to create a fake Embed object, for use with the Context::send_message and ExecuteWebhook::embeds methods.

Examples

Refer to the documentation for Context::send_message for a very in-depth example on how to use this.

Methods

impl CreateEmbed
[src]

Set the author of the embed.

Refer to the documentation for CreateEmbedAuthor for more information.

Set the colour of the left-hand side of the embed.

This is an alias of colour.

Set the colour of the left-hand side of the embed.

Set the description of the embed.

Note: This can't be longer than 2048 characters.

Set a field. Note that this will not overwrite other fields, and will add to them.

Refer to the documentation for CreateEmbedField for more information.

Note: Maximum amount of characters you can put is 256 in a field name and 1024 in a field value and a field is inline by default.

Set the footer of the embed.

Refer to the documentation for CreateEmbedFooter for more information.

Set the image associated with the embed. This only supports HTTP(S).

Set the thumbnail of the embed. This only supports HTTP(S).

Set the timestamp.

Note: This timestamp must be in ISO-8601 format. It must also be in UTC format.

Examples

You may pass a direct string:

  • 2017-01-03T23:00:00
  • 2004-06-08T16:04:23
  • 2004-06-08T16:04:23

Or a time::Tm:

extern crate time;

let now = time::now();

embed = embed.timestamp(now);
// ...

Set the title of the embed.

Set the URL to direct to when clicking on the title.

Trait Implementations

impl Default for CreateEmbed
[src]

Creates a builder with default values, setting the type to rich.

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.