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

Represents a tag that is able to be applied to a thread in a forum channel. More...

#include <channel.h>

+ Inheritance diagram for dpp::forum_tag:
+ Collaboration diagram for dpp::forum_tag:

Public Member Functions

 forum_tag ()
 
 forum_tag (const std::string &name)
 Constructor. More...
 
virtual ~forum_tag ()
 
forum_tagfill_from_json (nlohmann::json *j)
 Read struct values from a json object. More...
 
std::string build_json (bool with_id=false) const
 Build json for this forum_tag object. More...
 
forum_tagset_name (const std::string &name)
 Set name of this forum_tag object. 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

std::string name
 
std::variant< std::monostate, snowflake, std::string > emoji
 
bool moderated
 
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 a tag that is able to be applied to a thread in a forum channel.

Constructor & Destructor Documentation

◆ forum_tag() [1/2]

dpp::forum_tag::forum_tag ( )

Constructor

◆ forum_tag() [2/2]

dpp::forum_tag::forum_tag ( const std::string &  name)

Constructor.

Parameters
nameThe name of the tag. It will be truncated to the maximum length of 20 UTF-8 characters.

◆ ~forum_tag()

virtual dpp::forum_tag::~forum_tag ( )
virtual

Destructor

Member Function Documentation

◆ build_json()

std::string dpp::forum_tag::build_json ( bool  with_id = false) const

Build json for this forum_tag object.

Parameters
with_idinclude the ID in the json
Returns
std::string JSON string

◆ fill_from_json()

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

Read struct values from a json object.

Parameters
jjson to read values 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.

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

forum_tag & dpp::forum_tag::set_name ( const std::string &  name)

Set name of this forum_tag object.

Parameters
nameName to set
Returns
Reference to self, so these method calls may be chained
Note
name will be truncated to 20 chars, if longer

Member Data Documentation

◆ emoji

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

◆ 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.

◆ moderated

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

◆ name

std::string dpp::forum_tag::name

The name of the tag (0-20 characters)

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