A rich embed for display within a dpp::message.
More...
#include <message.h>
A rich embed for display within a dpp::message.
◆ embed() [1/2]
◆ embed() [2/2]
dpp::embed::embed |
( |
nlohmann::json * |
j | ) |
|
Constructor to build embed from json object.
- Parameters
-
j | JSON to read content from |
◆ ~embed()
◆ add_field()
embed & dpp::embed::add_field |
( |
std::string_view |
name, |
|
|
std::string_view |
value, |
|
|
bool |
is_inline = false |
|
) |
| |
Add an embed field.
- Parameters
-
name | The name of the field. It will be truncated to the maximum length of 256 UTF-8 characters. |
value | The value of the field. It will be truncated to the maximum length of 1024 UTF-8 characters. |
is_inline | Whether or not to display the field 'inline' or on its own line |
- Returns
- A reference to self so this method may be "chained".
◆ set_author() [1/2]
Set embed author.
- Parameters
-
- Returns
- A reference to self so this method may be "chained".
◆ set_author() [2/2]
embed & dpp::embed::set_author |
( |
std::string_view |
name, |
|
|
std::string_view |
url, |
|
|
std::string_view |
icon_url |
|
) |
| |
Set embed author.
- Parameters
-
name | The name of the author. It will be truncated to the maximum length of 256 UTF-8 characters. |
url | The url of the author (only supports http(s)) |
icon_url | The icon URL of the author (only supports http(s) and attachments) |
- Returns
- A reference to self so this method may be "chained".
◆ set_color()
embed & dpp::embed::set_color |
( |
uint32_t |
col | ) |
|
Set embed colour.
- Parameters
-
col | The colour of the embed |
- Returns
- A reference to self so this method may be "chained".
◆ set_colour()
embed & dpp::embed::set_colour |
( |
uint32_t |
col | ) |
|
Set embed colour.
- Parameters
-
col | The colour of the embed |
- Returns
- A reference to self so this method may be "chained".
◆ set_description()
embed & dpp::embed::set_description |
( |
std::string_view |
text | ) |
|
Set embed description.
- Parameters
-
text | The text of the title. It will be truncated to the maximum length of 4096 UTF-8 characters. |
- Returns
- A reference to self so this method may be "chained".
◆ set_footer() [1/2]
Set the footer of the embed.
- Parameters
-
- Returns
- A reference to self so this method may be "chained".
◆ set_footer() [2/2]
embed & dpp::embed::set_footer |
( |
std::string_view |
text, |
|
|
std::string_view |
icon_url |
|
) |
| |
Set the footer of the embed.
- Parameters
-
text | string to set as footer text. It will be truncated to the maximum length of 2048 UTF-8 characters. |
icon_url | an url to set as footer icon url (only supports http(s) and attachments) |
- Returns
- A reference to self so this method may be "chained".
◆ set_image()
embed & dpp::embed::set_image |
( |
std::string_view |
url | ) |
|
Set embed image.
- Parameters
-
url | The embed image URL (only supports http(s) and attachments) |
- Returns
- A reference to self so this method may be "chained".
◆ set_provider()
embed & dpp::embed::set_provider |
( |
std::string_view |
name, |
|
|
std::string_view |
url |
|
) |
| |
Set embed provider.
- Parameters
-
name | The provider name. It will be truncated to the maximum length of 256 UTF-8 characters. |
url | The provider url |
- Returns
- A reference to self so this method may be "chained".
◆ set_thumbnail()
embed & dpp::embed::set_thumbnail |
( |
std::string_view |
url | ) |
|
Set embed thumbnail.
- Parameters
-
url | The embed thumbnail url (only supports http(s) and attachments) |
- Returns
- A reference to self so this method may be "chained".
◆ set_timestamp()
embed & dpp::embed::set_timestamp |
( |
time_t |
tstamp | ) |
|
Set embed timestamp.
- Parameters
-
tstamp | The timestamp to show in the footer, should be in UTC |
- Returns
- A reference to self so this method may be "chained".
◆ set_title()
embed & dpp::embed::set_title |
( |
std::string_view |
text | ) |
|
Set embed title.
- Parameters
-
text | The text of the title. It will be truncated to the maximum length of 256 UTF-8 characters. |
- Returns
- A reference to self so this method may be "chained".
◆ set_url()
embed & dpp::embed::set_url |
( |
std::string_view |
url | ) |
|
Set embed url.
- Parameters
-
- Returns
- A reference to self so this method may be "chained".
◆ set_video()
embed & dpp::embed::set_video |
( |
std::string_view |
url | ) |
|
Set embed video.
- Parameters
-
- Returns
- A reference to self so this method may be "chained".
◆ author
Optional: Author information.
◆ color
std::optional<uint32_t> dpp::embed::color |
Optional: Color code of the embed.
◆ description
std::string dpp::embed::description |
Optional: Description of embed.
◆ fields
Optional: Fields information.
◆ footer
Optional: Footer information.
◆ image
Optional: Image information.
◆ provider
Optional: Provider information.
- Warning
- Can't send this.
◆ thumbnail
Optional: Thumbnail information.
◆ timestamp
time_t dpp::embed::timestamp |
Optional: Timestamp of embed content.
◆ title
std::string dpp::embed::title |
Optional: Title of embed.
◆ type
std::string dpp::embed::type |
Optional: Type of embed.
- Note
- Always "rich" for webhook embeds.
◆ url
std::string dpp::embed::url |
◆ video
Optional: Video information.
- Warning
- Can't send this.