D++ (DPP)
C++ Discord API Bot Library
|
Represents stickers received in messages. More...
#include <message.h>
Public Member Functions | |
sticker () | |
Construct a new sticker object. More... | |
virtual | ~sticker ()=default |
std::string | get_url () const |
Get the sticker url. More... | |
sticker & | set_filename (const std::string &fn) |
Set the filename. More... | |
sticker & | set_file_content (const std::string &fc) |
Set the file content. More... | |
constexpr double | get_creation_time () const noexcept |
Get the creation time of this object according to Discord. More... | |
constexpr bool | operator== (const managed &other) const noexcept |
Comparison operator for comparing two managed objects by id. More... | |
constexpr bool | operator!= (const managed &other) const noexcept |
Comparison operator for comparing two managed objects by id. More... | |
sticker & | fill_from_json (nlohmann::json *j) |
Convert object from nlohmann::json. More... | |
auto | to_json (bool with_id=false) const |
Convert object to nlohmann::json. More... | |
std::string | build_json (bool with_id=false) const |
Convert object to json string. More... | |
Public Attributes | |
snowflake | pack_id |
Optional: for standard stickers, id of the pack the sticker is from. More... | |
std::string | name |
The name of the sticker. More... | |
std::string | description |
Description of the sticker. More... | |
std::string | tags |
The sticker's (or related) expressions. More... | |
std::string | asset |
Asset ID. More... | |
sticker_type | type |
The type of sticker. More... | |
sticker_format | format_type |
type of sticker format. More... | |
bool | available |
Optional: Whether this guild sticker can be used. 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 |
Name of file to upload (when adding or editing a sticker). More... | |
std::string | filecontent |
File content to upload (raw binary). More... | |
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... | |
Protected Member Functions | |
sticker & | fill_from_json_impl (nlohmann::json *j) |
virtual json | to_json_impl (bool with_id=true) const |
Friends | |
struct | json_interface< sticker > |
Represents stickers received in messages.
dpp::sticker::sticker | ( | ) |
Construct a new sticker object.
|
virtualdefault |
|
inlineinherited |
Convert object to json string.
with_id | Whether to include the ID or not |
|
inlineinherited |
Convert object from nlohmann::json.
j | nlohmann::json object |
|
protected |
Read class values from json object
j | A json object to read from |
|
inlineconstexprnoexceptinherited |
Get the creation time of this object according to Discord.
std::string dpp::sticker::get_url | ( | ) | const |
Get the sticker url.
|
inlineconstexprnoexceptinherited |
Comparison operator for comparing two managed objects by id.
other | Other object to compare against |
|
inlineconstexprnoexceptinherited |
Comparison operator for comparing two managed objects by id.
other | Other object to compare against |
sticker & dpp::sticker::set_file_content | ( | const std::string & | fc | ) |
Set the file content.
fc | raw file content contained in std::string |
sticker & dpp::sticker::set_filename | ( | const std::string & | fn | ) |
Set the filename.
fn | filename |
|
inlineinherited |
Convert object to nlohmann::json.
with_id | Whether to include the ID or not |
|
protectedvirtual |
Build JSON from this object.
with_id | True if the ID is to be set in the JSON structure |
|
friend |
std::string dpp::sticker::asset |
Asset ID.
bool dpp::sticker::available |
Optional: Whether this guild sticker can be used.
std::string dpp::sticker::description |
Description of the sticker.
std::string dpp::sticker::filecontent |
File content to upload (raw binary).
std::string dpp::sticker::filename |
Name of file to upload (when adding or editing a sticker).
sticker_format dpp::sticker::format_type |
type of sticker format.
snowflake dpp::sticker::guild_id |
Optional: ID of the guild that owns this sticker.
|
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.
std::string dpp::sticker::name |
The name of the sticker.
snowflake dpp::sticker::pack_id |
Optional: for standard stickers, id of the pack the sticker is from.
uint8_t dpp::sticker::sort_value |
Optional: The standard sticker's sort order within its pack.
user dpp::sticker::sticker_user |
Optional: The user that uploaded the guild sticker.
std::string dpp::sticker::tags |
The sticker's (or related) expressions.
sticker_type dpp::sticker::type |
The type of sticker.