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 |
( |
const std::string & |
name, |
|
|
const std::string & |
value, |
|
|
bool |
is_inline = false |
|
) |
| |
Add an embed field. Returns the embed itself so these method calls may be "chained"
- 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
◆ set_author() [1/2]
Set embed author. Returns the embed itself so these method calls may be "chained"
- Parameters
-
- Returns
- A reference to self
◆ set_author() [2/2]
embed & dpp::embed::set_author |
( |
const std::string & |
name, |
|
|
const std::string & |
url, |
|
|
const std::string & |
icon_url |
|
) |
| |
Set embed author. Returns the embed itself so these method calls may be "chained"
- 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 |
icon_url | The icon URL of the author |
- Returns
- A reference to self
◆ set_color()
embed & dpp::embed::set_color |
( |
uint32_t |
col | ) |
|
Set embed colour. Returns the embed itself so these method calls may be "chained"
- Parameters
-
col | The colour of the embed |
- Returns
- A reference to self
◆ set_description()
embed & dpp::embed::set_description |
( |
const std::string & |
text | ) |
|
Set embed description. Returns the embed itself so these method calls may be "chained"
- 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
◆ set_footer() [1/2]
Set the footer of the embed. Returns the embed itself so these method calls may be "chained"
- Parameters
-
- Returns
- A reference to self
◆ set_footer() [2/2]
embed & dpp::embed::set_footer |
( |
const std::string & |
text, |
|
|
const std::string & |
icon_url |
|
) |
| |
Set the footer of the embed. Returns the embed itself so these method calls may be "chained"
- Parameters
-
text | string to set as footer text. It will be truncated to the maximum length of 2048 UTF-8 characters. |
icon_url | url to set as footer icon url |
- Returns
- A reference to self
◆ set_image()
embed & dpp::embed::set_image |
( |
const std::string & |
url | ) |
|
Set embed image. Returns the embed itself so these method calls may be "chained"
- Parameters
-
- Returns
- A reference to self
◆ set_provider()
embed & dpp::embed::set_provider |
( |
const std::string & |
name, |
|
|
const std::string & |
url |
|
) |
| |
Set embed provider. Returns the embed itself so these method calls may be "chained"
- 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
◆ set_thumbnail()
embed & dpp::embed::set_thumbnail |
( |
const std::string & |
url | ) |
|
Set embed thumbnail. Returns the embed itself so these method calls may be "chained"
- Parameters
-
url | The embed thumbnail url |
- Returns
- A reference to self
◆ set_timestamp()
embed & dpp::embed::set_timestamp |
( |
time_t |
tstamp | ) |
|
Set embed timestamp. Returns the embed itself so these method calls may be "chained"
- Parameters
-
tstamp | The timestamp to show in the footer, should be in UTC |
- Returns
- A reference to self
◆ set_title()
embed & dpp::embed::set_title |
( |
const std::string & |
text | ) |
|
Set embed title. Returns the embed itself so these method calls may be "chained"
- 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
◆ set_url()
embed & dpp::embed::set_url |
( |
const std::string & |
url | ) |
|
Set embed url. Returns the embed itself so these method calls may be "chained"
- Parameters
-
- Returns
- A reference to self
◆ set_video()
embed & dpp::embed::set_video |
( |
const std::string & |
url | ) |
|
Set embed video. Returns the embed itself so these method calls may be "chained"
- Parameters
-
- Returns
- A reference to self
◆ author
Optional: author information
◆ color
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 (can't send these)
◆ thumbnail
Optional: thumbnail information
◆ timestamp
time_t dpp::embed::timestamp |
Optional: timestamp of embed content
◆ title
std::string dpp::embed::title |
◆ type
std::string dpp::embed::type |
Optional: type of embed (always "rich" for webhook embeds)
◆ url
std::string dpp::embed::url |
◆ video
Optional: video information (can't send these)