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

Represents an onboarding prompt. More...

#include "guild.h"

Inheritance diagram for dpp::onboarding_prompt:
Collaboration diagram for dpp::onboarding_prompt:

Public Member Functions

 onboarding_prompt ()
 Construct a new onboarding prompt object. More...
 
virtual ~onboarding_prompt ()=default
 Destroy the onboarding prompt object. More...
 
std::string build_json (bool with_id=false) const
 Convert object to json string. More...
 
onboarding_promptfill_from_json (nlohmann::json *j)
 Convert object from nlohmann::json. More...
 
constexpr double get_creation_time () const noexcept
 Get the creation time of this object according to Discord. More...
 
bool is_in_onboarding () const
 Indicates whether the prompt is present in the onboarding flow. More...
 
bool is_required () const
 Indicates whether the prompt is required before a user completes the onboarding flow. More...
 
bool is_single_select () const
 Indicates whether users are limited to selecting one option for the prompt. 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...
 
onboarding_promptset_title (const std::string &_title)
 Set the title of this onboarding prompt object. More...
 
onboarding_promptset_type (const onboarding_prompt_type _type)
 Set the type of this onboarding prompt object. More...
 
auto to_json (bool with_id=false) const
 Convert object to nlohmann::json. More...
 

Public Attributes

uint8_t flags
 A set of flags built from the bitmask defined by dpp::onboarding_prompt_flags. More...
 
snowflake id = {}
 Unique ID of object set by Discord. More...
 
std::vector< onboarding_prompt_optionoptions
 Options available within the prompt. More...
 
std::string title
 Title of the prompt. More...
 
onboarding_prompt_type type
 Type of prompt (defaults to dpp::opt_multiple_choice). More...
 

Protected Member Functions

onboarding_promptfill_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_prompt >
 

Detailed Description

Represents an onboarding prompt.

Constructor & Destructor Documentation

◆ onboarding_prompt()

dpp::onboarding_prompt::onboarding_prompt ( )

Construct a new onboarding prompt object.

References dpp::json_interface< T >::to_json().

Here is the call graph for this function:

◆ ~onboarding_prompt()

virtual dpp::onboarding_prompt::~onboarding_prompt ( )
virtualdefault

Destroy the onboarding prompt object.

Member Function Documentation

◆ build_json()

std::string dpp::json_interface< onboarding_prompt >::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()

onboarding_prompt & dpp::json_interface< onboarding_prompt >::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_prompt & dpp::onboarding_prompt::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

◆ get_creation_time()

constexpr double dpp::managed::get_creation_time ( ) const
inlineconstexprnoexceptinherited

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.

◆ is_in_onboarding()

bool dpp::onboarding_prompt::is_in_onboarding ( ) const

Indicates whether the prompt is present in the onboarding flow.

Returns
bool True if the prompt is present in the onboarding flow. False if the prompt will only appear in the Channels & Roles tab

◆ is_required()

bool dpp::onboarding_prompt::is_required ( ) const

Indicates whether the prompt is required before a user completes the onboarding flow.

Returns
bool True if the prompt is required before a user completes the onboarding flow

◆ is_single_select()

bool dpp::onboarding_prompt::is_single_select ( ) const

Indicates whether users are limited to selecting one option for the prompt.

Returns
bool True if the users are limited to selecting one option for the prompt

◆ operator!=()

constexpr bool dpp::managed::operator!= ( const managed other) const
inlineconstexprnoexceptinherited

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

constexpr bool dpp::managed::operator== ( const managed other) const
inlineconstexprnoexceptinherited

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

◆ set_title()

onboarding_prompt & dpp::onboarding_prompt::set_title ( const std::string &  _title)

Set the title of this onboarding prompt object.

Parameters
_titleThe title to set
Returns
Reference to self, so these method calls may be chained

◆ set_type()

onboarding_prompt & dpp::onboarding_prompt::set_type ( const onboarding_prompt_type  _type)

Set the type of this onboarding prompt object.

Parameters
_typeThe prompt type to set
Returns
Reference to self, so these method calls may be chained

◆ to_json()

auto dpp::json_interface< onboarding_prompt >::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_prompt::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_prompt >

friend struct json_interface< onboarding_prompt >
friend

Member Data Documentation

◆ flags

uint8_t dpp::onboarding_prompt::flags

A set of flags built from the bitmask defined by dpp::onboarding_prompt_flags.

◆ id

◆ options

std::vector<onboarding_prompt_option> dpp::onboarding_prompt::options

Options available within the prompt.

◆ title

std::string dpp::onboarding_prompt::title

Title of the prompt.

◆ type

onboarding_prompt_type dpp::onboarding_prompt::type

Type of prompt (defaults to dpp::opt_multiple_choice).


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