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

Represents an automod action. More...

#include "automod.h"

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&>().to_json_impl(bool{}))>
std::string build_json (bool with_id=false) const
 Convert object to json string. 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...
 

Public Attributes

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. More...
 
uint32_t duration_seconds
 Timeout duration in seconds (Maximum of 2419200), for dpp::amod_action_timeout. More...
 
automod_action_type type
 Type of action to take. 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()

dpp::automod_action::~automod_action ( )
virtualdefault

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

Referenced by dpp::cluster::create_webhook(), dpp::cluster::guild_ban_add(), dpp::cluster::guild_ban_delete(), dpp::cluster::guild_command_edit_permissions(), dpp::cluster::guild_create(), dpp::cluster::guild_get_integrations(), dpp::cluster::guild_get_preview(), dpp::cluster::guild_get_vanity(), and dpp::cluster::roles_get().

Here is the caller graph for this function:

◆ 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

Referenced by dpp::invite::fill_from_json_impl(), dpp::thread::fill_from_json_impl(), dpp::scheduled_event::fill_from_json_impl(), dpp::from_json(), dpp::message::get_url(), and dpp::interaction_response::interaction_response().

Here is the caller graph for this function:

◆ 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

References type.

◆ 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

Referenced by dpp::cluster::delete_webhook_with_token(), and dpp::onboarding_prompt::onboarding_prompt().

Here is the caller graph for this function:

◆ to_json_impl()

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.

Referenced by fill_from_json_impl().


The documentation for this struct was generated from the following files: