D++ (DPP)
C++ Discord API Bot Library
dpp::sticker Struct Reference

Represents stickers received in messages. More...

#include <message.h>

+ Inheritance diagram for dpp::sticker:
+ Collaboration diagram for dpp::sticker:

Public Member Functions

 sticker ()
 Construct a new sticker object. More...
 
virtual ~sticker ()=default
 
stickerfill_from_json (nlohmann::json *j)
 
virtual std::string build_json (bool with_id=true) const
 
std::string get_url (bool accept_lottie=true) const
 Get the sticker url. More...
 
stickerset_filename (const std::string &fn)
 Set the filename. More...
 
stickerset_file_content (const std::string &fc)
 Set the file content. More...
 
double get_creation_time () const
 Get the creation time of this object according to Discord. More...
 
bool operator== (const managed &other) const noexcept
 Comparison operator for comparing two managed objects by id. More...
 
bool operator!= (const managed &other) const noexcept
 Comparison operator for comparing two managed objects by id. More...
 

Public Attributes

snowflake pack_id
 
std::string name
 
std::string description
 description of the sticker (may be empty) More...
 
std::string tags
 
std::string asset
 Asset ID. More...
 
sticker_type type
 
sticker_format format_type
 type of sticker format More...
 
bool available
 Optional: whether this guild sticker can be used, may be false due to loss of Server Boosts. More...
 
snowflake guild_id
 Optional: id of the guild that owns this sticker. More...
 
user sticker_user
 Optional: the user that uploaded the guild sticker. More...
 
uint8_t sort_value
 Optional: the standard sticker's sort order within its pack. More...
 
std::string filename
 
std::string filecontent
 
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. More...
 

Detailed Description

Represents stickers received in messages.

Constructor & Destructor Documentation

◆ sticker()

dpp::sticker::sticker ( )

Construct a new sticker object.

◆ ~sticker()

virtual dpp::sticker::~sticker ( )
virtualdefault

Member Function Documentation

◆ build_json()

virtual std::string dpp::sticker::build_json ( bool  with_id = true) const
virtual

Build JSON from this object.

Parameters
with_idTrue if the ID is to be set in the JSON structure
Returns
The JSON text of the invite

Reimplemented from dpp::json_interface< sticker >.

◆ fill_from_json()

sticker & dpp::sticker::fill_from_json ( nlohmann::json *  j)

Read class values from json object

Parameters
jA json object to read from
Returns
A reference to self

◆ 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_url()

std::string dpp::sticker::get_url ( bool  accept_lottie = true) const

Get the sticker url.

Parameters
accept_lottieWhether to allow that lottie (json format) can be returned or not
Returns
std::string The sticker url or an empty string when its a lottie and accept_lottie is false

◆ operator!=()

bool dpp::managed::operator!= ( const managed other) const
noexceptinherited

Comparison operator for comparing two managed objects by id.

Parameters
otherOther 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
noexceptinherited

Comparison operator for comparing two managed objects by id.

Parameters
otherOther object to compare against
Returns
true objects are the same id
false objects are not the same id

◆ set_file_content()

sticker & dpp::sticker::set_file_content ( const std::string &  fc)

Set the file content.

Parameters
fcraw file content contained in std::string
Returns
message& reference to self

◆ set_filename()

sticker & dpp::sticker::set_filename ( const std::string &  fn)

Set the filename.

Parameters
fnfilename
Returns
message& reference to self

Member Data Documentation

◆ asset

std::string dpp::sticker::asset

Asset ID.

Deprecated:
now an empty string but still sent by discord. While discord still send this empty string value we will still have a field here in the library.

◆ available

bool dpp::sticker::available

Optional: whether this guild sticker can be used, may be false due to loss of Server Boosts.

◆ description

std::string dpp::sticker::description

description of the sticker (may be empty)

◆ filecontent

std::string dpp::sticker::filecontent

File content to upload (raw binary)

◆ filename

std::string dpp::sticker::filename

Name of file to upload (when adding or editing a sticker)

◆ format_type

sticker_format dpp::sticker::format_type

type of sticker format

◆ guild_id

snowflake dpp::sticker::guild_id

Optional: id of the guild that owns this sticker.

◆ 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::name

The name of the sticker

◆ pack_id

snowflake dpp::sticker::pack_id

Optional: for standard stickers, id of the pack the sticker is from

◆ sort_value

uint8_t dpp::sticker::sort_value

Optional: the standard sticker's sort order within its pack.

◆ sticker_user

user dpp::sticker::sticker_user

Optional: the user that uploaded the guild sticker.

◆ tags

std::string dpp::sticker::tags

for guild stickers, the Discord name of a unicode emoji representing the sticker's expression. for standard stickers, a comma-separated list of related expressions.

◆ type

sticker_type dpp::sticker::type

The type of sticker

D++ Library version 10.0.35D++ Library version 10.0.34D++ Library version 10.0.33D++ Library version 10.0.32D++ Library version 10.0.31D++ Library version 10.0.30D++ Library version 10.0.29D++ Library version 10.0.28D++ Library version 10.0.27D++ Library version 10.0.26D++ Library version 10.0.25D++ Library version 10.0.24D++ Library version 10.0.23D++ Library version 10.0.22D++ Library version 10.0.21D++ Library version 10.0.20D++ Library version 10.0.19D++ Library version 10.0.18D++ Library version 10.0.17D++ Library version 10.0.16D++ Library version 10.0.15D++ Library version 10.0.14D++ Library version 10.0.13D++ Library version 10.0.12D++ Library version 10.0.11D++ Library version 10.0.10D++ Library version 10.0.9D++ Library version 10.0.8D++ Library version 10.0.7D++ Library version 10.0.6D++ Library version 10.0.5D++ Library version 10.0.4D++ Library version 10.0.3D++ Library version 10.0.2D++ Library version 10.0.1D++ Library version 10.0.0D++ Library version 9.0.19D++ Library version 9.0.18D++ Library version 9.0.17D++ Library version 9.0.16D++ Library version 9.0.15D++ Library version 9.0.14D++ Library version 9.0.13D++ Library version 9.0.12D++ Library version 9.0.11D++ Library version 9.0.10D++ Library version 9.0.9D++ Library version 9.0.8D++ Library version 9.0.7D++ Library version 9.0.6D++ Library version 9.0.5D++ Library version 9.0.4D++ Library version 9.0.3D++ Library version 9.0.2D++ Library version 9.0.1D++ Library version 9.0.0D++ Library version 1.0.2D++ Library version 1.0.1D++ Library version 1.0.0