A scheduled event. More...
#include "scheduled_event.h"
Public Member Functions | |
scheduled_event () | |
Create a scheduled_event object. More... | |
template<typename U = T, typename = decltype(std::declval<U&>().to_json_impl(bool{}))> | |
std::string | build_json (bool with_id=false) const |
Convert object to json string. More... | |
scheduled_event & | clear_description () |
Clear the description of the event. More... | |
template<typename U = T, typename = decltype(std::declval<U&>().fill_from_json_impl(std::declval<nlohmann::json*>()))> | |
T & | 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... | |
scheduled_event & | load_image (const std::byte *data, uint32_t size, const image_type type) |
Load an image for the event cover. More... | |
scheduled_event & | load_image (std::string_view image_blob, const image_type type) |
Load an image for the event cover. 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... | |
scheduled_event & | set_channel_id (snowflake c) |
Set the voice channel id of the event. More... | |
scheduled_event & | set_creator_id (snowflake c) |
Set the creator id of the event. More... | |
scheduled_event & | set_description (const std::string &d) |
Set the description of the event. More... | |
scheduled_event & | set_end_time (time_t t) |
Set the end time of the event. More... | |
scheduled_event & | set_location (const std::string &l) |
Set the location of the event. More... | |
scheduled_event & | set_name (const std::string &n) |
Set the name of the event. More... | |
scheduled_event & | set_start_time (time_t t) |
Set the start time of the event. More... | |
scheduled_event & | set_status (event_status s) |
Set the status of the event. More... | |
template<typename U = T, typename = decltype(std::declval<U&>().to_json_impl(bool{}))> | |
auto | to_json (bool with_id=false) const |
Convert object to nlohmann::json. More... | |
Public Attributes | |
snowflake | channel_id |
The channel ID in which the scheduled event will be hosted, or null if scheduled entity type is EXTERNAL. More... | |
user | creator |
Optional: The creator of the scheduled event. More... | |
snowflake | creator_id |
Optional: The ID of the user that created the scheduled event. More... | |
std::string | description |
Optional: The description of the scheduled event (1-1000 characters). More... | |
snowflake | entity_id |
Any additional ID of the hosting entity associated with event. More... | |
event_entities | entity_metadata |
The entity metadata for the scheduled event. More... | |
event_entity_type | entity_type |
The type of hosting entity associated with a scheduled event. More... | |
snowflake | guild_id |
The guild ID which the scheduled event belongs to. More... | |
snowflake | id = {} |
Unique ID of object set by Discord. More... | |
utility::icon | image |
The image of the scheduled event. More... | |
std::string | name |
The name of the scheduled event. More... | |
event_privacy_level | privacy_level |
The privacy level of the scheduled event. More... | |
time_t | scheduled_end_time |
The time the scheduled event will end, or null if the event does not have a scheduled time to end. More... | |
time_t | scheduled_start_time |
The time the scheduled event will start. More... | |
event_status | status |
The status of the scheduled event. More... | |
uint32_t | user_count |
Optional: The number of users subscribed to the scheduled event. More... | |
Protected Member Functions | |
scheduled_event & | fill_from_json_impl (const nlohmann::json *j) |
Serialise a scheduled_event object from json. More... | |
json | to_json_impl (bool with_id=false) const |
Build json for this object. More... | |
Friends | |
struct | json_interface< scheduled_event > |
A scheduled event.
dpp::scheduled_event::scheduled_event | ( | ) |
Create a scheduled_event object.
References description, and dpp::utility::validate().
|
inlineinherited |
Convert object to json string.
with_id | Whether to include the ID or not |
Referenced by dpp::cluster::create_webhook(), dpp::cluster::guild_ban_add(), dpp::cluster::guild_ban_delete(), dpp::cluster::guild_command_edit_permissions(), dpp::cluster::guild_create(), dpp::cluster::guild_get_integrations(), dpp::cluster::guild_get_preview(), dpp::cluster::guild_get_vanity(), and dpp::cluster::roles_get().
scheduled_event & dpp::scheduled_event::clear_description | ( | ) |
Clear the description of the event.
|
inlineinherited |
Convert object from nlohmann::json.
j | nlohmann::json object |
Referenced by dpp::invite::fill_from_json_impl(), dpp::thread::fill_from_json_impl(), fill_from_json_impl(), dpp::from_json(), dpp::message::get_url(), and dpp::interaction_response::interaction_response().
|
protected |
Serialise a scheduled_event object from json.
References creator, and dpp::json_interface< T >::fill_from_json().
|
inlineconstexprnoexceptinherited |
Get the creation time of this object according to Discord.
scheduled_event & dpp::scheduled_event::load_image | ( | const std::byte * | data, |
uint32_t | size, | ||
const image_type | type | ||
) |
Load an image for the event cover.
data | Image binary data |
size | Size of the image. |
type | Type of image. It can be one of i_gif , i_jpg or i_png . |
References entity_metadata, dpp::event_entities::location, and dpp::set_string_not_null().
scheduled_event & dpp::scheduled_event::load_image | ( | std::string_view | image_blob, |
const image_type | type | ||
) |
Load an image for the event cover.
image_blob | Image binary data |
type | Type of image. It can be one of i_gif , i_jpg or i_png . |
|
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 |
scheduled_event & dpp::scheduled_event::set_channel_id | ( | snowflake | c | ) |
Set the voice channel id of the event.
c | channel ID |
scheduled_event & dpp::scheduled_event::set_creator_id | ( | snowflake | c | ) |
Set the creator id of the event.
c | creator user ID |
scheduled_event & dpp::scheduled_event::set_description | ( | const std::string & | d | ) |
Set the description of the event.
Minimum length: 1 (if set), Maximum length: 100
d | event description |
dpp::length_error | if length < 1 |
scheduled_event & dpp::scheduled_event::set_end_time | ( | time_t | t | ) |
Set the end time of the event.
t | ending time |
dpp::length_error | if time is before now |
scheduled_event & dpp::scheduled_event::set_location | ( | const std::string & | l | ) |
Set the location of the event.
Minimum length: 1, Maximum length: 1000
l | event location |
dpp::length_error | if length < 1 |
scheduled_event & dpp::scheduled_event::set_name | ( | const std::string & | n | ) |
Set the name of the event.
Minimum length: 1, Maximum length: 100
n | event name |
dpp::length_error | if length < 1 |
scheduled_event & dpp::scheduled_event::set_start_time | ( | time_t | t | ) |
Set the start time of the event.
t | starting time |
dpp::length_error | if time is before now |
scheduled_event & dpp::scheduled_event::set_status | ( | event_status | s | ) |
Set the status of the event.
s | status to set |
dpp::logic_exception | if status change is not valid |
References dpp::err_event_start_time.
|
inlineinherited |
Convert object to nlohmann::json.
with_id | Whether to include the ID or not |
Referenced by dpp::cluster::delete_webhook_with_token(), and dpp::onboarding_prompt::onboarding_prompt().
|
protected |
Build json for this object.
with_id | Include id field in json |
|
friend |
snowflake dpp::scheduled_event::channel_id |
The channel ID in which the scheduled event will be hosted, or null if scheduled entity type is EXTERNAL.
user dpp::scheduled_event::creator |
Optional: The creator of the scheduled event.
Referenced by fill_from_json_impl().
snowflake dpp::scheduled_event::creator_id |
Optional: The ID of the user that created the scheduled event.
std::string dpp::scheduled_event::description |
Optional: The description of the scheduled event (1-1000 characters).
Referenced by scheduled_event().
snowflake dpp::scheduled_event::entity_id |
Any additional ID of the hosting entity associated with event.
e.g. stage instance ID.
event_entities dpp::scheduled_event::entity_metadata |
event_entity_type dpp::scheduled_event::entity_type |
The type of hosting entity associated with a scheduled event.
e.g. voice channel or stage channel.
snowflake dpp::scheduled_event::guild_id |
The guild ID which the scheduled event belongs to.
|
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().
utility::icon dpp::scheduled_event::image |
The image of the scheduled event.
std::string dpp::scheduled_event::name |
The name of the scheduled event.
event_privacy_level dpp::scheduled_event::privacy_level |
The privacy level of the scheduled event.
time_t dpp::scheduled_event::scheduled_end_time |
The time the scheduled event will end, or null if the event does not have a scheduled time to end.
time_t dpp::scheduled_event::scheduled_start_time |
The time the scheduled event will start.
event_status dpp::scheduled_event::status |
The status of the scheduled event.
uint32_t dpp::scheduled_event::user_count |
Optional: The number of users subscribed to the scheduled event.