Represents stickers received in messages. More...
#include "message.h"
Public Member Functions | |
sticker () | |
Construct a new sticker object. More... | |
virtual | ~sticker ()=default |
std::string | build_json (bool with_id=false) const |
Convert object to json string. More... | |
sticker & | fill_from_json (nlohmann::json *j) |
Convert object from nlohmann::json. More... | |
constexpr double | get_creation_time () const noexcept |
Get the creation time of this object according to Discord. More... | |
std::string | get_url () const |
Get the sticker url. 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 & | set_file_content (const std::string &fc) |
Set the file content. More... | |
sticker & | set_filename (const std::string &fn) |
Set the filename. More... | |
auto | to_json (bool with_id=false) const |
Convert object to nlohmann::json. More... | |
Public Attributes | |
std::string | asset |
Asset ID. More... | |
bool | available |
Optional: Whether this guild sticker can be used. More... | |
std::string | description |
Description of the sticker. More... | |
std::string | filecontent |
File content to upload (raw binary). More... | |
std::string | filename |
Name of file to upload (when adding or editing a sticker). More... | |
sticker_format | format_type |
type of sticker format. More... | |
snowflake | guild_id |
Optional: ID of the guild that owns this sticker. More... | |
snowflake | id = {} |
Unique ID of object set by Discord. More... | |
std::string | name |
The name of the sticker. More... | |
snowflake | pack_id |
Optional: for standard stickers, id of the pack the sticker is from. More... | |
uint8_t | sort_value |
Optional: The standard sticker's sort order within its pack. More... | |
user | sticker_user |
Optional: The user that uploaded the guild sticker. More... | |
std::string | tags |
The sticker's (or related) expressions. More... | |
sticker_type | type |
The type of sticker. More... | |
Protected Member Functions | |
sticker & | fill_from_json_impl (nlohmann::json *j) |
Read class values from json object. More... | |
virtual json | to_json_impl (bool with_id=true) const |
Build JSON from this object. More... | |
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 |
|
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.
Referenced by fill_from_json_impl().
bool dpp::sticker::available |
Optional: Whether this guild sticker can be used.
std::string dpp::sticker::description |
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.
Referenced by fill_from_json_impl().
|
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.
Referenced by dpp::poll::add_answer(), dpp::cluster::create_webhook(), dpp::cluster::current_user_join_thread(), dpp::invite::fill_from_json_impl(), dpp::command_permission::fill_from_json_impl(), dpp::interaction::get_resolved_role(), dpp::interaction::get_resolved_user(), dpp::cluster::global_bulk_command_create(), dpp::cluster::global_bulk_command_delete(), dpp::cluster::global_command_delete(), dpp::cluster::global_command_edit(), dpp::cluster::guild_ban_delete(), dpp::cluster::guild_command_create(), dpp::cluster::guild_command_edit_permissions(), dpp::cluster::guild_get_integrations(), dpp::events::guild_member_update::handle(), dpp::events::guild_role_create::handle(), dpp::events::channel_create::handle(), dpp::events::voice_state_update::handle(), dpp::discord_voice_client::handle_frame(), main(), dpp::component::set_disabled(), and dpp::select_option::set_label().
std::string dpp::sticker::name |
The name of the sticker.
Referenced by fill_from_json_impl().
snowflake dpp::sticker::pack_id |
Optional: for standard stickers, id of the pack the sticker is from.
Referenced by fill_from_json_impl().
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.
Referenced by dpp::message::get_url().
std::string dpp::sticker::tags |
The sticker's (or related) expressions.
Referenced by fill_from_json_impl().
sticker_type dpp::sticker::type |
The type of sticker.
Referenced by fill_from_json_impl().