| D++ (DPP) C++ Discord API Bot Library

Search
Loading...
Searching...
No Matches
dpp::integration Class Reference

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

`#include <integration.h>`

Inheritance diagram for dpp::integration:
[legend]
Collaboration diagram for dpp::integration:
[legend]

## Public Member Functions

| integration ()
| ~integration ()=default
std::string | build_json (bool with_id=false) const
| Convert object to json string.
bool | emoticons_enabled () const
bool | expiry_kicks_user () const
integration & | fill_from_json (nlohmann::json *j)
| Convert object from nlohmann::json.
constexpr double | get_creation_time () const noexcept
| Get the creation time of this object according to Discord.
bool | is_enabled () const
bool | is_revoked () const
bool | is_syncing () const
constexpr bool | operator!= (const managed &other) const noexcept
| Comparison operator for comparing two managed objects by id.
constexpr bool | operator== (const managed &other) const noexcept
| Comparison operator for comparing two managed objects by id.
auto | to_json (bool with_id=false) const
| Convert object to nlohmann::json.

## Public Attributes

integration_account | account
| Integration account information.
integration_app | app
| The bot/OAuth2 application for discord integrations.
uint32_t | expire_grace_period
| The grace period (in days) before expiring subscribers.
uint8_t | flags
| Integration flags from dpp::integration_flags.
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.
std::string | name
| Integration name.
snowflake | role_id
| ID that this integration uses for "subscribers".
std::vector< std::string > | scopes
| The scopes the application has been authorized for.
uint32_t | subscriber_count
| How many subscribers this integration has.
time_t | synced_at
| When this integration was last synced.
integration_type | type
| Integration type (twitch, youtube, discord, or guild_subscription).
user | user_obj
| User for this integration.

## Protected Member Functions

integration & | fill_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

inline inherited

Convert object to json string.

Parameters

  with_id | Whether 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 | ) |

inline inherited

Convert object from nlohmann::json.

Parameters

  j | nlohmann::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

  j | A json object to read from

Returns
  A reference to self

## ◆ get_creation_time()

double dpp::managed::get_creation_time | ( |  | ) | const

inline constexpr noexcept inherited

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

bool dpp::managed::operator!= | ( | const managed & | other | ) | const

inline constexpr noexcept inherited

Comparison operator for comparing two managed objects by id.

Parameters

  other | Other object to compare against

Returns
  true objects are not the same id
  false objects are the same id

## ◆ operator==()

bool dpp::managed::operator== | ( | const managed & | other | ) | const

inline constexpr noexcept inherited

Comparison operator for comparing two managed objects by id.

Parameters

  other | Other 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

inline inherited

Convert object to nlohmann::json.

Parameters

  with_id | Whether 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

protected virtual

Build a json from this object.

Parameters

  with_id | Add ID to output

Returns
  JSON of the object

## Friends And Related Symbol 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.13 D++ Library version 9.0.12 D++ Library version 9.0.11 D++ Library version 9.0.10 D++ Library version 9.0.9 D++ Library version 9.0.8 D++ Library version 9.0.7 D++ Library version 9.0.6 D++ Library version 9.0.5 D++ Library version 9.0.4 D++ Library version 9.0.3 D++ Library version 9.0.2 D++ Library version 9.0.1 D++ Library version 9.0.0 D++ Library version 1.0.2 D++ Library version 1.0.1 D++ Library version 1.0.0