D++ (DPP)
C++ Discord API Bot Library
dpp::automod_rule Class Reference

Represents an automod rule. More...

#include <automod.h>

+ Inheritance diagram for dpp::automod_rule:
+ Collaboration diagram for dpp::automod_rule:

Public Member Functions

 automod_rule ()
 Construct a new automod rule object. More...
 
virtual ~automod_rule ()
 Destroy the automod rule object. More...
 
automod_rulefill_from_json (nlohmann::json *j)
 Fill object properties from JSON. More...
 
virtual std::string build_json (bool with_id=false) const
 Build a json string for this 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

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_actionactions
 the actions which will execute when the rule is triggered More...
 
bool enabled
 Whether the rule is enabled. More...
 
std::vector< snowflakeexempt_roles
 the role ids that should not be affected by the rule (Maximum of 20) More...
 
std::vector< snowflakeexempt_channels
 the channel ids that should not be affected by the rule (Maximum of 50) More...
 

Detailed Description

Represents an automod rule.

Constructor & Destructor Documentation

◆ automod_rule()

dpp::automod_rule::automod_rule ( )

Construct a new automod rule object.

◆ ~automod_rule()

virtual dpp::automod_rule::~automod_rule ( )
virtual

Destroy the automod rule object.

Member Function Documentation

◆ build_json()

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

Build a json string for this object.

Returns
std::string JSON string

Reimplemented from dpp::json_interface< automod_rule >.

◆ fill_from_json()

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

Fill object properties from JSON.

Parameters
jJSON to fill from
Returns
automod_rule& 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

Member Data Documentation

◆ actions

std::vector<automod_action> dpp::automod_rule::actions

the actions which will execute when the rule is triggered

◆ creator_id

snowflake dpp::automod_rule::creator_id

The user which first created this rule.

◆ enabled

bool dpp::automod_rule::enabled

Whether the rule is enabled.

◆ event_type

automod_event_type dpp::automod_rule::event_type

The rule event type.

◆ exempt_channels

std::vector<snowflake> dpp::automod_rule::exempt_channels

the channel ids that should not be affected by the rule (Maximum of 50)

◆ exempt_roles

std::vector<snowflake> dpp::automod_rule::exempt_roles

the role ids that should not be affected by the rule (Maximum of 20)

◆ guild_id

snowflake dpp::automod_rule::guild_id

the guild which this rule belongs to

◆ id

snowflake dpp::automod_rule::id

the id of this rule

◆ name

std::string dpp::automod_rule::name

the rule name

◆ trigger_metadata

automod_metadata dpp::automod_rule::trigger_metadata

The rule trigger metadata.

◆ trigger_type

automod_trigger_type dpp::automod_rule::trigger_type

The rule trigger type.

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