Represents a tag that is able to be applied to a thread in a forum or media channel. More...
#include "channel.h"
Public Member Functions | |
forum_tag () | |
Constructor. More... | |
forum_tag (const std::string &name) | |
Constructor. More... | |
virtual | ~forum_tag ()=default |
Destructor. More... | |
std::string | build_json (bool with_id=false) const |
Convert object to json string. More... | |
forum_tag & | 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... | |
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 & | set_name (const std::string &name) |
Set name of this forum_tag object. More... | |
auto | to_json (bool with_id=false) const |
Convert object to nlohmann::json. More... | |
Public Attributes | |
std::variant< std::monostate, snowflake, std::string > | emoji |
The emoji of the tag. More... | |
snowflake | id = {} |
Unique ID of object set by Discord. More... | |
bool | moderated |
Whether this tag can only be added to or removed from threads by a member with the MANAGE_THREADS permission. More... | |
std::string | name |
The name of the tag (0-20 characters). 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 |
|
protected |
Build json for this forum_tag object.
with_id | include the ID in the json |
References dpp::permission_overwrite::allow, dpp::permission_overwrite::deny, dpp::permission_overwrite::id, and dpp::permission_overwrite::type.
|
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.
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().
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).