D++ (DPP)
C++ Discord API Bot Library
|
Represents an automod rule. More...
#include <automod.h>
Public Member Functions | |
automod_rule () | |
Construct a new automod rule object. More... | |
virtual | ~automod_rule () |
Destroy the automod rule 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... | |
automod_rule & | 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 | id |
the id of this rule More... | |
snowflake | guild_id |
the guild which this rule belongs to More... | |
std::string | name |
the rule name More... | |
snowflake | creator_id |
The user which first created this rule. More... | |
automod_event_type | event_type |
The rule event type. More... | |
automod_trigger_type | trigger_type |
The rule trigger type. More... | |
automod_metadata | trigger_metadata |
The rule trigger metadata. More... | |
std::vector< automod_action > | actions |
the actions which will execute when the rule is triggered More... | |
bool | enabled |
Whether the rule is enabled. More... | |
std::vector< snowflake > | exempt_roles |
the role ids that should not be affected by the rule (Maximum of 20) More... | |
std::vector< snowflake > | exempt_channels |
the channel ids that should not be affected by the rule (Maximum of 50) More... | |
Protected Member Functions | |
automod_rule & | fill_from_json_impl (nlohmann::json *j) |
Fill object properties from JSON. More... | |
virtual json | to_json_impl (bool with_id=false) const |
Build a json string for this object. More... | |
Friends | |
struct | json_interface< automod_rule > |
Represents an automod rule.
dpp::automod_rule::automod_rule | ( | ) |
Construct a new automod rule object.
|
virtual |
Destroy the automod rule object.
|
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 |
Fill object properties from JSON.
j | JSON to fill 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 |
|
inlineinherited |
Convert object to nlohmann::json.
with_id | Whether to include the ID or not |
|
protectedvirtual |
Build a json string for this object.
|
friend |
std::vector<automod_action> dpp::automod_rule::actions |
the actions which will execute when the rule is triggered
snowflake dpp::automod_rule::creator_id |
The user which first created this rule.
bool dpp::automod_rule::enabled |
Whether the rule is enabled.
automod_event_type dpp::automod_rule::event_type |
The rule event type.
std::vector<snowflake> dpp::automod_rule::exempt_channels |
the channel ids that should not be affected by the rule (Maximum of 50)
std::vector<snowflake> dpp::automod_rule::exempt_roles |
the role ids that should not be affected by the rule (Maximum of 20)
snowflake dpp::automod_rule::guild_id |
the guild which this rule belongs to
snowflake dpp::automod_rule::id |
the id of this rule
std::string dpp::automod_rule::name |
the rule name
automod_metadata dpp::automod_rule::trigger_metadata |
The rule trigger metadata.
automod_trigger_type dpp::automod_rule::trigger_type |
The rule trigger type.