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

Represents a guild's onboarding flow. More...

+ Inheritance diagram for dpp::onboarding:
+ Collaboration diagram for dpp::onboarding:

Public Member Functions

 onboarding ()
 Construct a new onboarding object. More...
 
virtual ~onboarding ()=default
 Destroy the onboarding object. More...
 
onboardingset_guild_id (const snowflake id)
 Set guild_id of this onboarding object. More...
 
onboardingset_mode (const onboarding_mode m)
 Set the mode of this onboarding object. More...
 
onboardingset_enabled (const bool is_enabled)
 Set the enabling of this onboarding 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

snowflake guild_id
 ID of the guild this onboarding is part of. More...
 
std::vector< onboarding_promptprompts
 Prompts shown during onboarding and in customize community. More...
 
std::vector< snowflakedefault_channel_ids
 Channel IDs that members get opted into automatically. More...
 
onboarding_mode mode
 Current mode of onboarding (defaults to dpp::gom_default) More...
 
bool enabled
 Whether onboarding is enabled in the guild. More...
 

Protected Member Functions

onboardingfill_from_json_impl (nlohmann::json *j)
 Read class values from json object. More...
 
json to_json_impl (bool with_id=false) const
 Build the json for this object. More...
 

Friends

struct json_interface< onboarding >
 

Detailed Description

Represents a guild's onboarding flow.

Constructor & Destructor Documentation

◆ onboarding()

dpp::onboarding::onboarding ( )

Construct a new onboarding object.

◆ ~onboarding()

virtual dpp::onboarding::~onboarding ( )
virtualdefault

Destroy the onboarding 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()

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

Read class values from json object.

Parameters
jA json object to read from
Returns
A reference to self

◆ set_enabled()

onboarding& dpp::onboarding::set_enabled ( const bool  is_enabled)

Set the enabling of this onboarding object.

Parameters
is_enabledbool Whether onboarding is enabled in the guild
Returns
Reference to self, so these method calls may be chained

◆ set_guild_id()

onboarding& dpp::onboarding::set_guild_id ( const snowflake  id)

Set guild_id of this onboarding object.

Parameters
guild_idGuild ID to set
Returns
Reference to self, so these method calls may be chained

◆ set_mode()

onboarding& dpp::onboarding::set_mode ( const onboarding_mode  m)

Set the mode of this onboarding object.

Parameters
monboarding_mode Mode to set
Returns
Reference to self, so these method calls may be chained

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

json dpp::onboarding::to_json_impl ( bool  with_id = false) const
protected

Build the json for this object.

Parameters
with_idinclude the id in the JSON
Returns
json data

Friends And Related Function Documentation

◆ json_interface< onboarding >

friend struct json_interface< onboarding >
friend

Member Data Documentation

◆ default_channel_ids

std::vector<snowflake> dpp::onboarding::default_channel_ids

Channel IDs that members get opted into automatically.

◆ enabled

bool dpp::onboarding::enabled

Whether onboarding is enabled in the guild.

◆ guild_id

snowflake dpp::onboarding::guild_id

ID of the guild this onboarding is part of.

◆ mode

onboarding_mode dpp::onboarding::mode

Current mode of onboarding (defaults to dpp::gom_default)

◆ prompts

std::vector<onboarding_prompt> dpp::onboarding::prompts

Prompts shown during onboarding and in customize community.

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