| D++ (DPP) C++ Discord API Bot Library

Search
Loading...
Searching...
No Matches
dpp::sticker_pack Struct Reference

Represents a sticker pack (the built in groups of stickers that all nitro users get to use). More...

`#include <message.h>`

Inheritance diagram for dpp::sticker_pack:
[legend]
Collaboration diagram for dpp::sticker_pack:
[legend]

## Public Member Functions

std::string | build_json (bool with_id=false) const
| Convert object to json string.
sticker_pack & | fill_from_json (nlohmann::json *j)
| Convert object from nlohmann::json.
constexpr double | get_creation_time () const noexcept
| Get the creation time of this object according to Discord.
constexpr bool | operator!= (const managed &other) const noexcept
| Comparison operator for comparing two managed objects by id.
constexpr bool | operator== (const managed &other) const noexcept
| Comparison operator for comparing two managed objects by id.
auto | to_json (bool with_id=false) const
| Convert object to nlohmann::json.

## Public Attributes

snowflake | banner_asset_id {}
| ID of the sticker pack's banner image.
snowflake | cover_sticker_id {0}
| Optional: ID of a sticker in the pack which is shown as the pack's icon.
std::string | description {}
| Description of the sticker pack.
snowflake | 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.
std::string | name {}
| Name of the sticker pack.
snowflake | sku_id {0}
| ID of the pack's SKU.
std::map< snowflake, sticker > | stickers {}
| The stickers in the pack.

## Protected Member Functions

sticker_pack & | fill_from_json_impl (nlohmann::json *j)
virtual json | to_json_impl (bool with_id=true) const

## Friends

struct | json_interface< sticker_pack >

## Detailed Description

Represents a sticker pack (the built in groups of stickers that all nitro users get to use).

## Member Function Documentation

## ◆ build_json()

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

inline inherited

Convert object to json string.

Parameters

  with_id | Whether to include the ID or not

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

Returns
  std::string Json built from the structure

## ◆ fill_from_json()

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

inline inherited

Convert object from nlohmann::json.

Parameters

  j | nlohmann::json object

Returns
  T& Reference to self for fluent calling

## ◆ fill_from_json_impl()

sticker_pack & dpp::sticker_pack::fill_from_json_impl | ( | nlohmann::json * | j | ) |

protected

Read class values from json object

Parameters

  j | A json object to read from

Returns
  A reference to self

## ◆ get_creation_time()

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

inline constexpr noexcept 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.

## ◆ operator!=()

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

inline constexpr noexcept inherited

Comparison operator for comparing two managed objects by id.

Parameters

  other | Other object to compare against

Returns
  true objects are not the same id
  false objects are the same id

## ◆ operator==()

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

inline constexpr noexcept inherited

Comparison operator for comparing two managed objects by id.

Parameters

  other | Other object to compare against

Returns
  true objects are the same id
  false objects are not the same id

## ◆ to_json()

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

inline inherited

Convert object to nlohmann::json.

Parameters

  with_id | Whether to include the ID or not

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

Returns
  json Json built from the structure

## ◆ to_json_impl()

virtual json dpp::sticker_pack::to_json_impl | ( | bool | with_id = true | ) | const

protected virtual

Build JSON from this object.

Parameters

  with_id | True if the ID is to be set in the JSON structure

Returns
  The JSON of the invite

## Friends And Related Symbol Documentation

## ◆ json_interface< sticker_pack >

friend struct json_interface< sticker_pack >

friend

## Member Data Documentation

## ◆ banner_asset_id

snowflake dpp::sticker_pack::banner_asset_id {}

ID of the sticker pack's banner image.

## ◆ cover_sticker_id

snowflake dpp::sticker_pack::cover_sticker_id {0}

Optional: ID of a sticker in the pack which is shown as the pack's icon.

## ◆ description

std::string dpp::sticker_pack::description {}

Description of the sticker pack.

## ◆ id

snowflake dpp::managed::id = {}

inherited

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.

## ◆ name

std::string dpp::sticker_pack::name {}

Name of the sticker pack.

## ◆ sku_id

snowflake dpp::sticker_pack::sku_id {0}

ID of the pack's SKU.

## ◆ stickers

std::map<snowflake, sticker> dpp::sticker_pack::stickers {}

The stickers in the pack.

D++ Library version 9.0.13 D++ Library version 9.0.12 D++ Library version 9.0.11 D++ Library version 9.0.10 D++ Library version 9.0.9 D++ Library version 9.0.8 D++ Library version 9.0.7 D++ Library version 9.0.6 D++ Library version 9.0.5 D++ Library version 9.0.4 D++ Library version 9.0.3 D++ Library version 9.0.2 D++ Library version 9.0.1 D++ Library version 9.0.0 D++ Library version 1.0.2 D++ Library version 1.0.1 D++ Library version 1.0.0