dpp::emoji
dpp::managed
dpp::json_interface< emoji >
emoji.h
struct friend struct json_interface< emoji > json_interface< emoji > dpp::emoji::json_interface< emoji > json_interface< emoji >
uint8_t uint8_t dpp::emoji::flags flags dpp::emoji::flags {0}

Flags for the emoji from dpp::emoji_flags.

snowflake snowflake dpp::managed::id id dpp::managed::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 relevant to us as useful metadata.

utility::image_data utility::image_data dpp::emoji::image_data image_data dpp::emoji::image_data

Image data for the emoji, if uploading.

std::string std::string dpp::emoji::name name dpp::emoji::name {}

Emoji name.

std::vector< snowflake > std::vector<snowflake> dpp::emoji::roles roles dpp::emoji::roles

Roles allowed to use this emoji.

snowflake snowflake dpp::emoji::user_id user_id dpp::emoji::user_id

The id of the user that created this emoji.

emoji & emoji & dpp::emoji::fill_from_json_impl (nlohmann::json *j) fill_from_json_impl dpp::emoji::fill_from_json_impl nlohmann::json * j

Read class values from json object.

j

A json object to read from

A reference to self

json json dpp::emoji::to_json_impl (bool with_id=false) const to_json_impl dpp::emoji::to_json_impl bool with_id false

Build the json for this object.

with_id

include the id in the JSON

std::string json data

dpp::emoji::emoji
()=default
emoji
dpp::emoji::emoji

Construct a new emoji object.

dpp::emoji::emoji
(const emoji &rhs)=default
emoji
dpp::emoji::emoji
const emoji & rhs

Copy constructor, copies another emoji's data.

rhs

Emoji to copy

dpp::emoji::emoji
(const std::string_view name, const snowflake id=0, const uint8_t flags=0)
emoji
dpp::emoji::emoji
const std::string_view name
const snowflake id 0
const uint8_t flags 0

Construct a new emoji object with name, ID and flags.

name

The emoji's name

id

ID, if it has one (unicode does not)

flags

Emoji flags (emoji_flags)

dpp::emoji::emoji
(emoji &&rhs) noexcept=default
emoji
dpp::emoji::emoji
emoji && rhs

Move constructor, moves another emoji's data to this.

rhs

Emoji to move from

dpp::emoji::~emoji
() override=default
~emoji
dpp::emoji::~emoji

Destroy the emoji object.

std::string std::string dpp::json_interface< emoji >::build_json (bool with_id=false) const build_json dpp::json_interface< emoji >::build_json bool with_id false

Convert object to json string.

with_id

Whether to include the ID or not

Some fields are conditionally filled, do not rely on all fields being present

std::string Json built from the structure

emoji & emoji & dpp::json_interface< emoji >::fill_from_json (nlohmann::json *j) fill_from_json dpp::json_interface< emoji >::fill_from_json nlohmann::json * j

Convert object from nlohmann::json.

j

nlohmann::json object

T& Reference to self for fluent calling

std::string std::string dpp::emoji::format () const format dpp::emoji::format

Format to name if unicode, name:id if has id or a:name:id if animated.

Formatted name for reactions

double double dpp::managed::get_creation_time () const noexcept get_creation_time dpp::managed::get_creation_time

Get the creation time of this object according to Discord.

double creation time inferred from the snowflake ID. The minimum possible value is the first second of 2015.

std::string std::string dpp::emoji::get_mention () const get_mention dpp::emoji::get_mention

Get the mention/ping for the emoji.

std::string mention

std::string std::string dpp::emoji::get_url (uint16_t size=0, const image_type format=i_png, bool prefer_animated=true) const get_url dpp::emoji::get_url uint16_t size 0 const image_type format i_png bool prefer_animated true

Get the custom emoji url.

size

The size of the emoji in pixels. It can be any power of two between 16 and 4096, otherwise the default sized emoji is returned.

format

The format to use for the emoji. It can be one of `i_webp`, `i_jpg`, `i_png` or `i_gif`. When passing `i_gif`, it returns an empty string for non-animated emojis. Consider using the `prefer_animated` parameter instead.

prefer_animated

Whether you prefer gif format. If true, it'll return gif format whenever the emoji is available as animated.

std::string emoji url or an empty string, if the id is not set

bool bool dpp::emoji::is_animated () const is_animated dpp::emoji::is_animated

Emoji is animated.

true Is animated

false Is noy animated

bool bool dpp::emoji::is_available () const is_available dpp::emoji::is_available

Is available.

true Is available

false Is unavailable

bool bool dpp::emoji::is_managed () const is_managed dpp::emoji::is_managed

Emoji is managed.

true Is managed

false Is not managed

emoji & emoji & dpp::emoji::load_image (const std::byte *data, uint32_t size, const image_type type) load_image dpp::emoji::load_image const std::byte * data uint32_t size const image_type type

Load an image into the object.

data

Image binary data

size

Size of the image.

type

Type of image. It can be one of `i_gif`, `i_jpg` or `i_png`.

emoji& Reference to self

dpp::length_exception

Image content exceeds discord maximum of 256 kilobytes

emoji & emoji & dpp::emoji::load_image (std::string_view image_blob, const image_type type) load_image dpp::emoji::load_image std::string_view image_blob const image_type type

Load an image into the object.

image_blob

Image binary data

type

Type of image. It can be one of `i_gif`, `i_jpg` or `i_png`.

emoji& Reference to self

dpp::length_exception

Image content exceeds discord maximum of 256 kilobytes

bool bool dpp::managed::operator!= (const managed &other) const noexcept operator!= dpp::managed::operator!= const managed & other

Comparison operator for comparing two managed objects by id.

other

Other object to compare against

true objects are not the same id

false objects are the same id

emoji & emoji & dpp::emoji::operator= (const emoji &rhs)=default operator= dpp::emoji::operator= const emoji & rhs

Copy assignment operator, copies another emoji's data.

rhs

Emoji to copy

emoji & emoji & dpp::emoji::operator= (emoji &&rhs) noexcept=default operator= dpp::emoji::operator= emoji && rhs

Move constructor, moves another emoji's data to this.

rhs

Emoji to move from

bool bool dpp::managed::operator== (const managed &other) const noexcept operator== dpp::managed::operator== const managed & other

Comparison operator for comparing two managed objects by id.

other

Other object to compare against

true objects are the same id

false objects are not the same id

bool bool dpp::emoji::requires_colons () const requires_colons dpp::emoji::requires_colons

Emoji requires colons.

true Requires colons

false Does not require colons

auto auto dpp::json_interface< emoji >::to_json (bool with_id=false) const to_json dpp::json_interface< emoji >::to_json bool with_id false

Convert object to nlohmann::json.

with_id

Whether to include the ID or not

Some fields are conditionally filled, do not rely on all fields being present

json Json built from the structure

std::string static std::string dpp::emoji::get_mention (std::string_view name, snowflake id, bool is_animated=false) get_mention dpp::emoji::get_mention std::string_view name snowflake id bool is_animated false

Create a mentionable emoji.

name

The name of the emoji.

id

The ID of the emoji.

is_animated

is emoji animated.

std::string The formatted mention of the emoji.

Represents an emoji for a dpp::guild.

dpp::emoji
dpp::json_interface< T >
dpp::json_interface< emoji >
< emoji >
dpp::managed
T
dpp::emoji
name
roles
user_id
image_data
flags
dpp::json_interface< T >
dpp::json_interface< emoji >
< emoji >
dpp::managed
id
dpp::snowflake
value
dpp::utility::image_data
data
size
type
image_type
std::basic_string< Char >
byte
std::string
std::unique_ptr< T >
ptr
std::unique_ptr< std::byte[]>
ptr
< std::byte[]>
std::vector< T >
elements
std::vector< dpp::snowflake >
elements
< dpp::snowflake >
uint32_t
uint64_t
uint8_t
- dpp::emoji
  build_json
- dpp::emoji
  emoji
- dpp::emoji
  emoji
- dpp::emoji
  emoji
- dpp::emoji
  emoji
- dpp::emoji
  fill_from_json
- dpp::emoji
  fill_from_json_impl
- dpp::emoji
  flags
- dpp::emoji
  format
- dpp::emoji
  get_creation_time
- dpp::emoji
  get_mention
- dpp::emoji
  get_mention
- dpp::emoji
  get_url
- dpp::emoji
  id
- dpp::emoji
  image_data
- dpp::emoji
  is_animated
- dpp::emoji
  is_available
- dpp::emoji
  is_managed
- dpp::emoji
  json_interface< emoji >
- dpp::emoji
  load_image
- dpp::emoji
  load_image
- dpp::emoji
  managed
- dpp::emoji
  managed
- dpp::emoji
  managed
- dpp::emoji
  managed
- dpp::emoji
  name
- dpp::emoji
  operator!=
- dpp::emoji
  operator=
- dpp::emoji
  operator=
- dpp::emoji
  operator=
- dpp::emoji
  operator=
- dpp::emoji
  operator==
- dpp::emoji
  requires_colons
- dpp::emoji
  roles
- dpp::emoji
  to_json
- dpp::emoji
  to_json_impl
- dpp::emoji
  user_id
- dpp::emoji
  ~emoji
- dpp::emoji
  ~managed