D++ (DPP)
C++ Discord API Bot Library
dpp::integration Class Reference

Represents an integration on a guild, e.g. a connection to twitch. More...

+ Inheritance diagram for dpp::integration:
+ Collaboration diagram for dpp::integration:

Public Member Functions

 integration ()
 
 ~integration ()=default
 
bool emoticons_enabled () const
 
bool is_enabled () const
 
bool is_syncing () const
 
bool is_revoked () const
 
bool expiry_kicks_user () const
 
constexpr double get_creation_time () const noexcept
 Get the creation time of this object according to Discord. 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...
 
integrationfill_from_json (nlohmann::json *j)
 Convert object from nlohmann::json. More...
 
auto to_json (bool with_id=false) const
 Convert object to nlohmann::json. More...
 
std::string build_json (bool with_id=false) const
 Convert object to json string. More...
 

Public Attributes

std::string name
 Integration name. More...
 
integration_type type
 Integration type (twitch, youtube, discord, or guild_subscription). More...
 
uint8_t flags
 Integration flags from dpp::integration_flags. More...
 
snowflake role_id
 ID that this integration uses for "subscribers". More...
 
uint32_t expire_grace_period
 The grace period (in days) before expiring subscribers. More...
 
user user_obj
 User for this integration. More...
 
integration_account account
 Integration account information. More...
 
time_t synced_at
 When this integration was last synced. More...
 
uint32_t subscriber_count
 How many subscribers this integration has. More...
 
integration_app app
 The bot/OAuth2 application for discord integrations. More...
 
std::vector< std::string > scopes
 The scopes the application has been authorized for. More...
 
snowflake id = {}
 Unique ID of object set by Discord. This value contains a timestamp, worker ID, internal server ID, and an incrementing value. Only the timestamp is relevant to us as useful metadata. More...
 

Protected Member Functions

integrationfill_from_json_impl (nlohmann::json *j)
 
virtual json to_json_impl (bool with_id=false) const
 

Friends

struct json_interface< integration >
 

Detailed Description

Represents an integration on a guild, e.g. a connection to twitch.

Constructor & Destructor Documentation

◆ integration()

dpp::integration::integration ( )

Default constructor

◆ ~integration()

dpp::integration::~integration ( )
default

Default destructor

Member Function Documentation

◆ build_json()

std::string dpp::json_interface< integration >::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

◆ emoticons_enabled()

bool dpp::integration::emoticons_enabled ( ) const

Are emoticons enabled for this integration?

Warning
This is not provided for discord bot integrations.

◆ expiry_kicks_user()

bool dpp::integration::expiry_kicks_user ( ) const

Will the user be kicked if their subscription runs out to the integration? If false, the integration will simply remove the role that is specified by role_id.

Warning
This is not provided for discord bot integrations.

◆ fill_from_json()

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

integration& dpp::integration::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_enabled()

bool dpp::integration::is_enabled ( ) const

Is the integration enabled?

Warning
This is not provided for discord bot integrations.

◆ is_revoked()

bool dpp::integration::is_revoked ( ) const

Has this integration been revoked?

Warning
This is not provided for discord bot integrations.

◆ is_syncing()

bool dpp::integration::is_syncing ( ) const

Is the integration syncing?

Warning
This is not provided for discord bot integrations.

◆ 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

◆ to_json()

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

Build a json from this object.

Parameters
with_idAdd ID to output
Returns
JSON of the object

Friends And Related Function Documentation

◆ json_interface< integration >

friend struct json_interface< integration >
friend

Member Data Documentation

◆ account

integration_account dpp::integration::account

Integration account information.

◆ app

integration_app dpp::integration::app

The bot/OAuth2 application for discord integrations.

◆ expire_grace_period

uint32_t dpp::integration::expire_grace_period

The grace period (in days) before expiring subscribers.

Warning
This is not provided for discord bot integrations.

◆ flags

uint8_t dpp::integration::flags

Integration flags from dpp::integration_flags.

◆ id

snowflake dpp::managed::id = {}
inherited

Unique ID of object set by Discord. This value contains a timestamp, worker ID, internal server ID, and an incrementing value. Only the timestamp is relevant to us as useful metadata.

◆ name

std::string dpp::integration::name

Integration name.

◆ role_id

snowflake dpp::integration::role_id

ID that this integration uses for "subscribers".

Warning
This is not provided for discord bot integrations.

◆ scopes

std::vector<std::string> dpp::integration::scopes

The scopes the application has been authorized for.

◆ subscriber_count

uint32_t dpp::integration::subscriber_count

How many subscribers this integration has.

Warning
This is not provided for discord bot integrations.

◆ synced_at

time_t dpp::integration::synced_at

When this integration was last synced.

Warning
This is not provided for discord bot integrations.

◆ type

integration_type dpp::integration::type

Integration type (twitch, youtube, discord, or guild_subscription).

◆ user_obj

user dpp::integration::user_obj

User for this integration.

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