Represents an emoji for a dpp::guild.
More...
#include <emoji.h>
Represents an emoji for a dpp::guild.
◆ emoji() [1/2]
Construct a new emoji object.
◆ emoji() [2/2]
dpp::emoji::emoji |
( |
const std::string |
n, |
|
|
const snowflake |
i = 0 , |
|
|
const uint8_t |
f = 0 |
|
) |
| |
Construct a new emoji object with name, ID and flags.
- Parameters
-
n | The emoji's name |
i | ID, if it has one (unicode does not) |
f | Emoji flags (emoji_flags) |
◆ ~emoji()
virtual dpp::emoji::~emoji |
( |
| ) |
|
|
virtual |
Destroy the emoji object.
◆ build_json()
std::string dpp::emoji::build_json |
( |
bool |
with_id = false | ) |
const |
Build the json for this object.
- Parameters
-
with_id | include the id in the JSON |
- Returns
- std::string json data
◆ fill_from_json()
Read class values from json object.
- Parameters
-
j | A json object to read from |
- Returns
- A reference to self
◆ format()
std::string dpp::emoji::format |
( |
| ) |
const |
Format to name if unicode, name:id if has id or a:name:id if animated.
- Returns
- Formatted name for reactions
◆ get_creation_time()
double dpp::managed::get_creation_time |
( |
| ) |
const |
|
inherited |
Get the creation time of this object according to Discord.
- Returns
- double creation time inferred from the snowflake ID. The minimum possible value is the first second of 2015.
◆ get_mention()
std::string dpp::emoji::get_mention |
( |
| ) |
const |
Get the mention/ping for the emoji.
- Returns
- std::string mention
◆ is_animated()
bool dpp::emoji::is_animated |
( |
| ) |
const |
Emoji is animated.
- Returns
- true Is animated
-
false Is noy animated
◆ is_available()
bool dpp::emoji::is_available |
( |
| ) |
const |
Is available.
- Returns
- true Is available
-
false Is unavailable
◆ is_managed()
bool dpp::emoji::is_managed |
( |
| ) |
const |
Emoji is managed.
- Returns
- true Is managed
-
false Is not managed
◆ load_image()
emoji & dpp::emoji::load_image |
( |
const std::string & |
image_blob, |
|
|
const image_type |
type |
|
) |
| |
Load an image into the object as base64.
- Parameters
-
image_blob | Image binary data |
type | Type of image |
- Returns
- emoji& Reference to self
- Exceptions
-
◆ requires_colons()
bool dpp::emoji::requires_colons |
( |
| ) |
const |
Emoji requires colons.
- Returns
- true Requires colons
-
false Does not require colons
◆ flags
uint8_t dpp::emoji::flags |
◆ id
Unique ID of object set by Discord. This value contains a timestamp, worker ID, internal server ID, and an incrementing value. Only the timestamp is relavent to us as useful metadata.
◆ image_data
std::string* dpp::emoji::image_data |
Image data for the emoji if uploading.
◆ name
std::string dpp::emoji::name |
◆ user_id
User id who uploaded the emoji.