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

Represents an automod action. More...

+ Inheritance diagram for dpp::automod_action:
+ Collaboration diagram for dpp::automod_action:

Public Member Functions

 automod_action ()
 Construct a new automod action object. More...
 
virtual ~automod_action ()
 Destroy the automod action object. More...
 
template<typename U = T, typename = decltype(std::declval<U&>().fill_from_json_impl(std::declval<nlohmann::json*>()))>
T & fill_from_json (nlohmann::json *j)
 Convert object from nlohmann::json. More...
 
template<typename U = T, typename = decltype(std::declval<U&>().to_json_impl(bool{}))>
auto to_json (bool with_id=false) const
 Convert object to nlohmann::json. More...
 
template<typename U = T, typename = decltype(std::declval<U&>().to_json_impl(bool{}))>
std::string build_json (bool with_id=false) const
 Convert object to json string. More...
 

Public Attributes

automod_action_type type
 Type of action to take. More...
 
snowflake channel_id
 Channel ID to which user content should be logged, for type dpp::amod_action_send_alert. More...
 
std::string custom_message
 Additional explanation that will be shown to members whenever their message is blocked. For type dpp::amod_action_block_message. More...
 
uint32_t duration_seconds
 Timeout duration in seconds (Maximum of 2419200), for dpp::amod_action_timeout. More...
 

Protected Member Functions

automod_actionfill_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 for this object. More...
 

Friends

struct json_interface< automod_action >
 

Detailed Description

Represents an automod action.

Constructor & Destructor Documentation

◆ automod_action()

dpp::automod_action::automod_action ( )

Construct a new automod action object.

◆ ~automod_action()

virtual dpp::automod_action::~automod_action ( )
virtual

Destroy the automod action object.

Member Function Documentation

◆ build_json()

template<typename T >
template<typename U = T, typename = decltype(std::declval<U&>().to_json_impl(bool{}))>
std::string dpp::json_interface< T >::build_json ( bool  with_id = false) const
inlineinherited

Convert object to json string.

Parameters
with_idWhether to include the ID or not
Note
Some fields are conditionally filled, do not rely on all fields being present
Returns
std::string Json built from the structure

◆ fill_from_json()

template<typename T >
template<typename U = T, typename = decltype(std::declval<U&>().fill_from_json_impl(std::declval<nlohmann::json*>()))>
T& dpp::json_interface< T >::fill_from_json ( nlohmann::json *  j)
inlineinherited

Convert object from nlohmann::json.

Parameters
jnlohmann::json object
Returns
T& Reference to self for fluent calling

◆ fill_from_json_impl()

automod_action& dpp::automod_action::fill_from_json_impl ( nlohmann::json *  j)
protected

Fill object properties from JSON.

Parameters
jJSON to fill from
Returns
automod_action& Reference to self

◆ to_json()

template<typename T >
template<typename U = T, typename = decltype(std::declval<U&>().to_json_impl(bool{}))>
auto dpp::json_interface< T >::to_json ( bool  with_id = false) const
inlineinherited

Convert object to nlohmann::json.

Parameters
with_idWhether to include the ID or not
Note
Some fields are conditionally filled, do not rely on all fields being present
Returns
json Json built from the structure

◆ to_json_impl()

virtual json dpp::automod_action::to_json_impl ( bool  with_id = false) const
protectedvirtual

Build a json for this object.

Returns
json JSON object

Friends And Related Function Documentation

◆ json_interface< automod_action >

friend struct json_interface< automod_action >
friend

Member Data Documentation

◆ channel_id

snowflake dpp::automod_action::channel_id

Channel ID to which user content should be logged, for type dpp::amod_action_send_alert.

◆ custom_message

std::string dpp::automod_action::custom_message

Additional explanation that will be shown to members whenever their message is blocked. For type dpp::amod_action_block_message.

◆ duration_seconds

uint32_t dpp::automod_action::duration_seconds

Timeout duration in seconds (Maximum of 2419200), for dpp::amod_action_timeout.

◆ type

automod_action_type dpp::automod_action::type

Type of action to take.

D++ 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