D++ (DPP)
C++ Discord API Bot Library
|
Represents a tag that is able to be applied to a thread in a forum or media channel. More...
Public Member Functions | |
forum_tag () | |
forum_tag (const std::string &name) | |
Constructor. More... | |
virtual | ~forum_tag ()=default |
forum_tag & | set_name (const std::string &name) |
Set name of this forum_tag object. 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... | |
forum_tag & | 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 | |
std::string | name |
The name of the tag (0-20 characters). More... | |
std::variant< std::monostate, snowflake, std::string > | emoji |
The emoji of the tag. Contains either nothing, the id of a guild's custom emoji or the unicode character of the emoji. More... | |
bool | moderated |
Whether this tag can only be added to or removed from threads by a member with the MANAGE_THREADS permission. 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 | |
forum_tag & | fill_from_json_impl (nlohmann::json *j) |
Read struct values from a json object. More... | |
json | to_json_impl (bool with_id=false) const |
Build json for this forum_tag object. More... | |
Friends | |
struct | json_interface< forum_tag > |
Represents a tag that is able to be applied to a thread in a forum or media channel.
dpp::forum_tag::forum_tag | ( | ) |
Constructor
dpp::forum_tag::forum_tag | ( | const std::string & | name | ) |
Constructor.
name | The name of the tag. It will be truncated to the maximum length of 20 UTF-8 characters. |
|
virtualdefault |
Destructor
|
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 struct values from a json object.
j | json to read values from |
|
inlineconstexprnoexceptinherited |
Get the creation time of this object according to Discord.
|
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 |
forum_tag& dpp::forum_tag::set_name | ( | const std::string & | name | ) |
Set name of this forum_tag object.
name | Name to set |
|
inlineinherited |
Convert object to nlohmann::json.
with_id | Whether to include the ID or not |
Build json for this forum_tag object.
with_id | include the ID in the json |
|
friend |
std::variant<std::monostate, snowflake, std::string> dpp::forum_tag::emoji |
The emoji of the tag. Contains either nothing, the id of a guild's custom emoji or the unicode character of the emoji.
|
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.
bool dpp::forum_tag::moderated |
Whether this tag can only be added to or removed from threads by a member with the MANAGE_THREADS
permission.
std::string dpp::forum_tag::name |
The name of the tag (0-20 characters).