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

Defines a server's welcome screen. More...

#include "guild.h"

Inheritance diagram for dpp::welcome_screen:
Collaboration diagram for dpp::welcome_screen:

Public Member Functions

 welcome_screen ()=default
 Construct a new welcome screen object. More...
 
virtual ~welcome_screen ()=default
 Destroy the welcome screen object. More...
 
std::string build_json (bool with_id=false) const
 Convert object to json string. More...
 
welcome_screenfill_from_json (nlohmann::json *j)
 Convert object from nlohmann::json. More...
 
welcome_screenset_description (const std::string &s)
 Set the server description for this welcome screen object shown in the welcome screen. More...
 
auto to_json (bool with_id=false) const
 Convert object to nlohmann::json. More...
 

Public Attributes

std::string description
 The server description shown in the welcome screen. More...
 
std::vector< welcome_channelwelcome_channels
 The channels shown in the welcome screen (max 5) More...
 

Protected Member Functions

welcome_screenfill_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< welcome_screen >
 

Detailed Description

Defines a server's welcome screen.

Constructor & Destructor Documentation

◆ welcome_screen()

dpp::welcome_screen::welcome_screen ( )
default

Construct a new welcome screen object.

◆ ~welcome_screen()

virtual dpp::welcome_screen::~welcome_screen ( )
virtualdefault

Destroy the welcome screen object.

Member Function Documentation

◆ build_json()

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

welcome_screen & dpp::json_interface< welcome_screen >::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()

welcome_screen & dpp::welcome_screen::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_description()

welcome_screen & dpp::welcome_screen::set_description ( const std::string &  s)

Set the server description for this welcome screen object shown in the welcome screen.

Parameters
sstring The server description
Returns
Reference to self, so these method calls may be chained

◆ to_json()

auto dpp::json_interface< welcome_screen >::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::welcome_screen::to_json_impl ( bool  with_id = false) const
protected

Build the json for this object.

Parameters
with_idinclude the id in the JSON
Returns
std::string json data

Friends And Related Function Documentation

◆ json_interface< welcome_screen >

friend struct json_interface< welcome_screen >
friend

Member Data Documentation

◆ description

std::string dpp::welcome_screen::description

The server description shown in the welcome screen.

Referenced by dpp::welcome_channel::set_channel_id().

◆ welcome_channels

std::vector<welcome_channel> dpp::welcome_screen::welcome_channels

The channels shown in the welcome screen (max 5)


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