Represents an integration on a guild, e.g. More...
#include "integration.h"
Public Member Functions | |
integration () | |
Default constructor. More... | |
~integration ()=default | |
Default destructor. More... | |
std::string | build_json (bool with_id=false) const |
Convert object to json string. More... | |
bool | emoticons_enabled () const |
Are emoticons enabled for this integration? More... | |
bool | 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 . More... | |
integration & | fill_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_enabled () const |
Is the integration enabled? More... | |
bool | is_revoked () const |
Has this integration been revoked? More... | |
bool | is_syncing () const |
Is the integration syncing? 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... | |
auto | to_json (bool with_id=false) const |
Convert object to nlohmann::json. More... | |
Public Attributes | |
integration_account | account |
Integration account information. More... | |
integration_app | app |
The bot/OAuth2 application for discord integrations. More... | |
uint32_t | expire_grace_period |
The grace period (in days) before expiring subscribers. More... | |
uint8_t | flags |
Integration flags from dpp::integration_flags. More... | |
snowflake | id = {} |
Unique ID of object set by Discord. More... | |
std::string | name |
Integration name. More... | |
snowflake | role_id |
ID that this integration uses for "subscribers". More... | |
std::vector< std::string > | scopes |
The scopes the application has been authorized for. More... | |
uint32_t | subscriber_count |
How many subscribers this integration has. More... | |
time_t | synced_at |
When this integration was last synced. More... | |
integration_type | type |
Integration type (twitch, youtube, discord, or guild_subscription). More... | |
user | user_obj |
User for this integration. More... | |
Protected Member Functions | |
integration & | fill_from_json_impl (nlohmann::json *j) |
Read class values from json object. More... | |
virtual json | to_json_impl (bool with_id=false) const |
Build a json from this object. More... | |
Friends | |
struct | json_interface< integration > |
Represents an integration on a guild, e.g.
a connection to twitch.
dpp::integration::integration | ( | ) |
Default constructor.
References dpp::unicode_emoji::flags, and dpp::if_syncing.
|
default |
Default destructor.
|
inlineinherited |
Convert object to json string.
with_id | Whether to include the ID or not |
bool dpp::integration::emoticons_enabled | ( | ) | const |
Are emoticons enabled for this integration?
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
.
|
inlineinherited |
Convert object from nlohmann::json.
j | nlohmann::json object |
|
protected |
Read class values from json object.
j | A json object to read from |
|
inlineconstexprnoexceptinherited |
Get the creation time of this object according to Discord.
bool dpp::integration::is_enabled | ( | ) | const |
Is the integration enabled?
bool dpp::integration::is_revoked | ( | ) | const |
Has this integration been revoked?
bool dpp::integration::is_syncing | ( | ) | const |
Is the integration syncing?
|
inlineconstexprnoexceptinherited |
Comparison operator for comparing two managed objects by id.
other | Other object to compare against |
|
inlineconstexprnoexceptinherited |
Comparison operator for comparing two managed objects by id.
other | Other object to compare against |
|
inlineinherited |
Convert object to nlohmann::json.
with_id | Whether to include the ID or not |
|
protectedvirtual |
Build a json from this object.
with_id | Add ID to output |
References dpp::unicode_emoji::flags, and dpp::if_revoked.
|
friend |
integration_account dpp::integration::account |
Integration account information.
integration_app dpp::integration::app |
The bot/OAuth2 application for discord integrations.
uint32_t dpp::integration::expire_grace_period |
The grace period (in days) before expiring subscribers.
uint8_t dpp::integration::flags |
Integration flags from dpp::integration_flags.
|
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.
Referenced by dpp::poll::add_answer(), dpp::cluster::create_webhook(), dpp::cluster::current_user_join_thread(), dpp::invite::fill_from_json_impl(), dpp::command_permission::fill_from_json_impl(), dpp::interaction::get_resolved_role(), dpp::interaction::get_resolved_user(), dpp::cluster::global_bulk_command_create(), dpp::cluster::global_bulk_command_delete(), dpp::cluster::global_command_delete(), dpp::cluster::global_command_edit(), dpp::cluster::guild_ban_delete(), dpp::cluster::guild_command_create(), dpp::cluster::guild_command_edit_permissions(), dpp::cluster::guild_get_integrations(), dpp::events::guild_member_update::handle(), dpp::events::guild_role_create::handle(), dpp::events::channel_create::handle(), dpp::events::voice_state_update::handle(), dpp::discord_voice_client::handle_frame(), main(), dpp::component::set_disabled(), and dpp::select_option::set_label().
std::string dpp::integration::name |
Integration name.
snowflake dpp::integration::role_id |
ID that this integration uses for "subscribers".
std::vector<std::string> dpp::integration::scopes |
The scopes the application has been authorized for.
uint32_t dpp::integration::subscriber_count |
How many subscribers this integration has.
time_t dpp::integration::synced_at |
When this integration was last synced.
integration_type dpp::integration::type |
Integration type (twitch, youtube, discord, or guild_subscription).
user dpp::integration::user_obj |
User for this integration.