diff --git a/include/dpp/auditlog.h b/include/dpp/auditlog.h index f5cc599baa..90339ec331 100644 --- a/include/dpp/auditlog.h +++ b/include/dpp/auditlog.h @@ -33,117 +33,284 @@ namespace dpp { * @brief Defines types of audit log entry */ enum audit_type { - /// Guild update - aut_guild_update = 1, - /// Channel create - aut_channel_create = 10, - /// Channel update - aut_channel_update = 11, - /// Channel delete - aut_channel_delete = 12, - /// Channel overwrite create - aut_channel_overwrite_create = 13, - /// Channel overwrite update - aut_channel_overwrite_update = 14, - /// Channel overwrite delete - aut_channel_overwrite_delete = 15, - /// Channel member kick - aut_member_kick = 20, - /// Channel member prune - aut_member_prune = 21, - /// Channel member ban add - aut_member_ban_add = 22, - /// Channel member ban remove - aut_member_ban_remove = 23, - /// Guild member update - aut_member_update = 24, - /// Guild member role update - aut_member_role_update = 25, - /// Guild member move - aut_member_move = 26, - /// Guild member voice disconnect - aut_member_disconnect = 27, - /// Guild bot add - aut_bot_add = 28, - /// Guild role create - aut_role_create = 30, - /// Guild role update - aut_role_update = 31, - /// Guild role delete - aut_role_delete = 32, - /// Guild invite create - aut_invite_create = 40, - /// Guild invite update - aut_invite_update = 41, - /// Guild invite delete - aut_invite_delete = 42, - /// Guild webhook create - aut_webhook_create = 50, - /// Guild webhook update - aut_webhook_update = 51, - /// Guild webhook delete - aut_webhook_delete = 52, - /// Guild emoji create - aut_emoji_create = 60, - /// Guild emoji update - aut_emoji_update = 61, - /// Guild emoji delete - aut_emoji_delete = 62, - /// Guild message delete - aut_message_delete = 72, - /// Guild message bulk delete - aut_message_bulk_delete = 73, - /// Guild message pin - aut_message_pin = 74, - /// Guild message unpin - aut_message_unpin = 75, - /// Guild integration create - aut_integration_create = 80, - /// Guild integration update - aut_integration_update = 81, - /// Guild integration delete - aut_integration_delete = 82, - /// Stage instance create - aut_stage_instance_create = 83, - /// Stage instance update - aut_stage_instance_update = 84, - /// stage instance delete - aut_stage_instance_delete = 85, - /// Sticker create - aut_sticker_create = 90, - /// Sticker update - aut_sticker_update = 91, - /// Sticker delete - aut_sticker_delete = 92, - /// Scheduled event creation - aut_guild_scheduled_event_create = 100, - /// Scheduled event update - aut_guild_scheduled_event_update = 101, - /// Scheduled event deletion - aut_guild_scheduled_event_delete = 102, - /// Thread create - aut_thread_create = 110, - /// Thread update - aut_thread_update = 111, - /// Thread delete - aut_thread_delete = 112, - /// Application command permissions update - aut_appcommand_permission_update = 121, - /// Auto moderation rule creation - aut_automod_rule_create = 140, - /// Auto moderation rule update - aut_automod_rule_update = 141, - /// Auto moderation rule deletion - aut_automod_rule_delete = 142, - /// Message was blocked by Auto Moderation - aut_automod_block_message = 143, - /// Message was flagged by Auto Moderation - aut_automod_flag_to_channel = 144, - /// Member was timed out by Auto Moderation - aut_automod_user_communication_disabled = 145, - /// Creator monetization request was created + /** + * @brief Guild update + */ + aut_guild_update = 1, + + /** + * @brief Channel create + */ + aut_channel_create = 10, + + /** + * @brief Channel update + */ + aut_channel_update = 11, + + /** + * @brief Channel delete + */ + aut_channel_delete = 12, + + /** + * @brief Channel overwrite create + */ + aut_channel_overwrite_create = 13, + + /** + * @brief Channel overwrite update + */ + aut_channel_overwrite_update = 14, + + /** + * @brief Channel overwrite delete + */ + aut_channel_overwrite_delete = 15, + + /** + * @brief Channel member kick + */ + aut_member_kick = 20, + + /** + * @brief Channel member prune + */ + aut_member_prune = 21, + + /** + * @brief Channel member ban add + */ + aut_member_ban_add = 22, + + /** + * @brief Channel member ban remove + */ + aut_member_ban_remove = 23, + + /** + * @brief Guild member update + */ + aut_member_update = 24, + + /** + * @brief Guild member role update + */ + aut_member_role_update = 25, + + /** + * @brief Guild member move + */ + aut_member_move = 26, + + /** + * @brief Guild member voice disconnect + */ + aut_member_disconnect = 27, + + /** + * @brief Guild bot add + */ + aut_bot_add = 28, + + /** + * @brief Guild role create + */ + aut_role_create = 30, + + /** + * @brief Guild role update + */ + aut_role_update = 31, + + /** + * @brief Guild role delete + */ + aut_role_delete = 32, + + /** + * @brief Guild invite create + */ + aut_invite_create = 40, + + /** + * @brief Guild invite update + */ + aut_invite_update = 41, + + /** + * @brief Guild invite delete + */ + aut_invite_delete = 42, + + /** + * @brief Guild webhook create + */ + aut_webhook_create = 50, + + /** + * @brief Guild webhook update + */ + aut_webhook_update = 51, + + /** + * @brief Guild webhook delete + */ + aut_webhook_delete = 52, + + /** + * @brief Guild emoji create + */ + aut_emoji_create = 60, + + /** + * @brief Guild emoji update + */ + aut_emoji_update = 61, + + /** + * @brief Guild emoji delete + */ + aut_emoji_delete = 62, + + /** + * @brief Guild message delete + */ + aut_message_delete = 72, + + /** + * @brief Guild message bulk delete + */ + aut_message_bulk_delete = 73, + + /** + * @brief Guild message pin + */ + aut_message_pin = 74, + + /** + * @brief Guild message unpin + */ + aut_message_unpin = 75, + + /** + * @brief Guild integration create + */ + aut_integration_create = 80, + + /** + * @brief Guild integration update + */ + aut_integration_update = 81, + + /** + * @brief Guild integration delete + */ + aut_integration_delete = 82, + + /** + * @brief Stage instance create + */ + aut_stage_instance_create = 83, + + /** + * @brief Stage instance update + */ + aut_stage_instance_update = 84, + + /** + * @brief stage instance delete + */ + aut_stage_instance_delete = 85, + + /** + * @brief Sticker create + */ + aut_sticker_create = 90, + + /** + * @brief Sticker update + */ + aut_sticker_update = 91, + + /** + * @brief Sticker delete + */ + aut_sticker_delete = 92, + + /** + * @brief Scheduled event creation + */ + aut_guild_scheduled_event_create = 100, + + /** + * @brief Scheduled event update + */ + aut_guild_scheduled_event_update = 101, + + /** + * @brief Scheduled event deletion + */ + aut_guild_scheduled_event_delete = 102, + + /** + * @brief Thread create + */ + aut_thread_create = 110, + + /** + * @brief Thread update + */ + aut_thread_update = 111, + + /** + * @brief Thread delete + */ + aut_thread_delete = 112, + + /** + * @brief Application command permissions update + */ + aut_appcommand_permission_update = 121, + + /** + * @brief Auto moderation rule creation + */ + aut_automod_rule_create = 140, + + /** + * @brief Auto moderation rule update + */ + aut_automod_rule_update = 141, + + /** + * @brief Auto moderation rule deletion + */ + aut_automod_rule_delete = 142, + + /** + * @brief Message was blocked by Auto Moderation + */ + aut_automod_block_message = 143, + + /** + * @brief Message was flagged by Auto Moderation + */ + aut_automod_flag_to_channel = 144, + + /** + * @brief Member was timed out by Auto Moderation + */ + aut_automod_user_communication_disabled = 145, + + /** + * @brief Creator monetization request was created + */ aut_creator_monetization_request_created = 150, - /// Creator monetization terms were accepted + + /** + * @brief Creator monetization terms were accepted + */ aut_creator_monetization_terms_accepted = 151, }; @@ -151,32 +318,81 @@ enum audit_type { * @brief Defines audit log changes */ struct DPP_EXPORT audit_change { - /// Optional: Serialised new value of the change, e.g. for nicknames, the new nickname - std::string new_value; - /// Optional: Serialised old value of the change, e.g. for nicknames, the old nickname - std::string old_value; /** - * The property name that was changed, e.g. `nick` for nickname changes - * @note For dpp::aut_appcommand_permission_update updates the key is the id of the user, channel, role, or a permission constant that was updated instead of an actual property name + * @brief Optional: Serialised new value of the change, e.g. for nicknames, the new nickname. + */ + std::string new_value; + + /** + * @brief Optional: Serialised old value of the change, e.g. for nicknames, the old nickname. + */ + std::string old_value; + + /** + * @brief The property name that was changed (e.g. `nick` for nickname changes). + * @note For dpp::aut_appcommand_permission_update updates the key is the id of the user, channel, role, or a permission constant that was updated instead of an actual property name. */ - std::string key; + std::string key; }; /** * @brief Extra information for an audit log entry */ struct DPP_EXPORT audit_extra { - std::string automod_rule_name; //!< Name of the Auto Moderation rule that was triggered - std::string automod_rule_trigger_type; //!< Trigger type of the Auto Moderation rule that was triggered - std::string delete_member_days; //!< number of days after which inactive members were kicked - std::string members_removed; //!< number of members removed by the prune - snowflake channel_id; //!< channel in which the entities were targeted - snowflake message_id; //!< id of the message that was targeted - std::string count; //!< number of entities that were targeted - snowflake id; //!< id of the overwritten entity - std::string type; //!< type of overwritten entity - "0" for "role" or "1" for "member" - std::string role_name; //!< name of the role if type is "0" (not present if type is "1") - snowflake application_id; //!< ID of the app whose permissions were targeted + /** + * @brief Name of the Auto Moderation rule that was triggered. + */ + std::string automod_rule_name; + + /** + * @brief Trigger type of the Auto Moderation rule that was triggered. + */ + std::string automod_rule_trigger_type; + + /** + * @brief Number of days after which inactive members were kicked. + */ + std::string delete_member_days; + + /** + * @brief Number of members removed by the prune. + */ + std::string members_removed; + + /** + * @brief Channel in which the entities were targeted. + */ + snowflake channel_id; + + /** + * @brief ID of the message that was targeted. + */ + snowflake message_id; + + /** + * @brief Number of entities that were targeted. + */ + std::string count; + + /** + * @brief ID of the overwritten entity. + */ + snowflake id; + + /** + * @brief Type of overwritten entity - "0" for "role" or "1" for "member" + */ + std::string type; + + /** + * @brief Name of the role if type is "0" (not present if type is "1"). + */ + std::string role_name; + + /** + * @brief ID of the app whose permissions were targeted + */ + snowflake application_id; }; /** @@ -193,17 +409,41 @@ struct DPP_EXPORT audit_entry : public json_interface { audit_entry& fill_from_json_impl(nlohmann::json* j); public: - snowflake id; //!< id of the entry + /** + * @brief ID of the entry. + */ + snowflake id; + /** * ID of the affected entity (webhook, user, role, etc.) (may be empty) * @note For dpp::audit_type::aut_appcommand_permission_update updates, it's the command ID or the app ID */ - snowflake target_id; - std::vector changes; //!< Optional: changes made to the target_id - snowflake user_id; //!< the user or app that made the changes (may be empty) - audit_type type; //!< type of action that occurred - std::optional extra; //!< Optional: additional info for certain action types - std::string reason; //!< Optional: the reason for the change (1-512 characters) + snowflake target_id; + + /** + * @brief Optional: changes made to the target_id. + */ + std::vector changes; + + /** + * @brief The user or app that made the changes (may be empty). + */ + snowflake user_id; + + /** + * @brief Type of action that occurred. + */ + audit_type type; + + /** + * @brief Optional: additional info for certain action types. + */ + std::optional extra; + + /** + * @brief Optional: the reason for the change (1-512 characters). + */ + std::string reason; /** Constructor */ audit_entry(); @@ -226,7 +466,10 @@ class DPP_EXPORT auditlog : public json_interface { auditlog& fill_from_json_impl(nlohmann::json* j); public: - std::vector entries; //!< Audit log entries + /** + * @brief Audit log entries. + */ + std::vector entries; /** Constructor */ auditlog() = default; diff --git a/include/dpp/channel.h b/include/dpp/channel.h index 14c1d92396..59080ee0df 100644 --- a/include/dpp/channel.h +++ b/include/dpp/channel.h @@ -37,28 +37,81 @@ namespace dpp { /** @brief Flag integers as received from and sent to discord */ enum channel_type : uint8_t { - CHANNEL_TEXT = 0, //!< a text channel within a server - DM = 1, //!< a direct message between users - CHANNEL_VOICE = 2, //!< a voice channel within a server + /** + * @brief A text channel within a server. + */ + CHANNEL_TEXT = 0, + + /** + * @brief A direct message between users. + */ + DM = 1, + + /** + * @brief A voice channel within a server. + */ + CHANNEL_VOICE = 2, + /** * @brief a direct message between multiple users - * @deprecated this channel type was intended to be used with the now deprecated GameBridge SDK. Existing group dms with bots will continue to function, but newly created channels will be unusable + * @deprecated this channel type was intended to be used with the now deprecated GameBridge SDK. + * Existing group dms with bots will continue to function, but newly created channels will be unusable. */ - GROUP_DM = 3, - CHANNEL_CATEGORY = 4, //!< an organizational category that contains up to 50 channels - CHANNEL_ANNOUNCEMENT = 5, //!< a channel that users can follow and crosspost into their own server + GROUP_DM = 3, + /** - * @brief a channel in which game developers can sell their game on Discord - * @deprecated store channels are deprecated by Discord + * @brief An organizational category that contains up to 50 channels. */ - CHANNEL_STORE = 6, - CHANNEL_ANNOUNCEMENT_THREAD = 10, //!< a temporary sub-channel within a GUILD_ANNOUNCEMENT channel - CHANNEL_PUBLIC_THREAD = 11, //!< a temporary sub-channel within a GUILD_TEXT or GUILD_FORUM channel - CHANNEL_PRIVATE_THREAD = 12, //!< a temporary sub-channel within a GUILD_TEXT channel that is only viewable by those invited and those with the MANAGE_THREADS permission - CHANNEL_STAGE = 13, //!< a "stage" channel, like a voice channel with one authorised speaker - CHANNEL_DIRECTORY = 14, //!< the channel in a [hub](https://support.discord.com/hc/en-us/articles/4406046651927-Discord-Student-Hubs-FAQ) containing the listed servers - CHANNEL_FORUM = 15, //!< forum channel that can only contain threads - CHANNEL_MEDIA = 16, //!< Media channel that can only contain threads, similar to forum channels + CHANNEL_CATEGORY = 4, + + /** + * @brief A channel that users can follow and cross-post into their own server. + */ + CHANNEL_ANNOUNCEMENT = 5, + + /** + * @brief A channel in which game developers can sell their game on Discord. + * @deprecated Store channels are deprecated by Discord. + */ + CHANNEL_STORE = 6, + + /** + * @brief A temporary sub-channel within a `GUILD_ANNOUNCEMENT` channel. + */ + CHANNEL_ANNOUNCEMENT_THREAD = 10, + + /** + * @brief A temporary sub-channel within a `GUILD_TEXT` or `GUILD_FORUM` channel. + */ + CHANNEL_PUBLIC_THREAD = 11, + + /** + * @brief A temporary sub-channel within a `GUILD_TEXT` channel + * that is only viewable by those invited and those with the `MANAGE_THREADS` permission. + */ + CHANNEL_PRIVATE_THREAD = 12, + + /** + * @brief A "stage" channel, like a voice channel with one authorised speaker. + */ + CHANNEL_STAGE = 13, + + /** + * @brief The channel in a hub containing the listed servers. + * + * @see https://support.discord.com/hc/en-us/articles/4406046651927-Discord-Student-Hubs-FAQ + */ + CHANNEL_DIRECTORY = 14, + + /** + * @brief Forum channel that can only contain threads. + */ + CHANNEL_FORUM = 15, + + /** + * @brief Media channel that can only contain threads, similar to forum channels. + */ + CHANNEL_MEDIA = 16, }; /** @brief Our flags as stored in the object @@ -68,18 +121,36 @@ enum channel_type : uint8_t { */ enum channel_flags : uint16_t { /* Note that bits 1 to 4 are used for the channel type mask */ - /// NSFW Gated Channel + /** + * @brief NSFW Gated Channel + */ c_nsfw = 0b0000000000010000, - /// Video quality forced to 720p + + /** + * @brief Video quality forced to 720p + */ c_video_quality_720p = 0b0000000000100000, - /// Lock permissions (only used when updating channel positions) + + /** + * @brief Lock permissions (only used when updating channel positions) + */ c_lock_permissions = 0b0000000001000000, - /// Thread is pinned to the top of its parent forum or media channel + + /** + * @brief Thread is pinned to the top of its parent forum or media channel + */ c_pinned_thread = 0b0000000010000000, - /// Whether a tag is required to be specified when creating a thread in a forum or a media channel. Tags are specified in the thread::applied_tags field. + + /** + * @brief Whether a tag is required to be specified when creating a thread in a forum or media channel. + * Tags are specified in the thread::applied_tags field. + */ c_require_tag = 0b0000000100000000, - /* Note that the 9th and 10th bit are used for the forum layout type */ - /// When set hides the embedded media download options. Available only for media channels + + /* Note that the 9th and 10th bit are used for the forum layout type. */ + /** + * @brief When set hides the embedded media download options. Available only for media channels + */ c_hide_media_download_options = 0b0001000000000000, }; @@ -87,9 +158,14 @@ enum channel_flags : uint16_t { * @brief Types for sort posts in a forum channel */ enum default_forum_sort_order_t : uint8_t { - /// Sort forum posts by activity (default) + /** + * @brief Sort forum posts by activity (default) + */ so_latest_activity = 0, - /// Sort forum posts by creation time (from most recent to oldest) + + /** + * @brief Sort forum posts by creation time (from most recent to oldest) + */ so_creation_date = 1, }; @@ -97,18 +173,34 @@ enum default_forum_sort_order_t : uint8_t { * @brief Types of forum layout views that indicates how the threads in a forum channel will be displayed for users by default */ enum forum_layout_type : uint8_t { - fl_not_set = 0, //!< No default has been set for the forum channel - fl_list_view = 1, //!< Display posts as a list - fl_gallery_view = 2, //!< Display posts as a collection of tiles + /** + * @brief No default has been set for the forum channel + */ + fl_not_set = 0, + + /** + * @brief Display posts as a list + */ + fl_list_view = 1, + + /** + * @brief Display posts as a collection of tiles + */ + fl_gallery_view = 2, }; /** * @brief channel permission overwrite types */ enum overwrite_type : uint8_t { - /// Role + /** + * @brief Role + */ ot_role = 0, - /// Member + + /** + * @brief Member + */ ot_member = 1 }; @@ -116,13 +208,24 @@ enum overwrite_type : uint8_t { * @brief Channel permission overwrites */ struct DPP_EXPORT permission_overwrite { - /// ID of the role or the member + /** + * @brief ID of the role or the member + */ snowflake id; - /// Bitmask of allowed permissions + + /** + * @brief Bitmask of allowed permissions + */ permission allow; - /// Bitmask of denied permissions + + /** + * @brief Bitmask of denied permissions + */ permission deny; - /// Type of overwrite. See dpp::overwrite_type + + /** + * @brief Type of overwrite. See dpp::overwrite_type + */ uint8_t type; /** @@ -145,15 +248,30 @@ struct DPP_EXPORT permission_overwrite { * @brief metadata for threads */ struct DPP_EXPORT thread_metadata { - /// Timestamp when the thread's archive status was last changed, used for calculating recent activity + /** + * @brief Timestamp when the thread's archive status was last changed, used for calculating recent activity. + */ time_t archive_timestamp; - /// The duration in minutes to automatically archive the thread after recent activity, can be set to: 60, 1440, 4320, 10080 + + /** + * @brief The duration in minutes to automatically archive the thread after recent activity (60, 1440, 4320, 10080). + */ uint16_t auto_archive_duration; - /// Whether a thread is archived + + /** + * @brief Whether a thread is archived + */ bool archived; - /// Whether a thread is locked. When a thread is locked, only users with `MANAGE_THREADS` can unarchive it + + /** + * @brief Whether a thread is locked. When a thread is locked, + * only users with `MANAGE_THREADS` can un-archive it. + */ bool locked; - /// Whether non-moderators can add other non-moderators. Only for private threads + + /** + * @brief Whether non-moderators can add other non-moderators. Only for private threads. + */ bool invitable; }; @@ -162,13 +280,24 @@ struct DPP_EXPORT thread_metadata { * Defined as an enum to fit into 1 byte. Internally it'll be translated to minutes to match the API */ enum auto_archive_duration_t : uint8_t { - /// Auto archive duration of 1 hour. (60 minutes) + /** + * @brief Auto archive duration of 1 hour (60 minutes). + */ arc_1_hour = 1, - /// Auto archive duration of 1 day. (1440 minutes) + + /** + * @brief Auto archive duration of 1 day (1440 minutes). + */ arc_1_day = 2, - /// Auto archive duration of 3 days. (4320 minutes) + + /** + * @brief Auto archive duration of 3 days (4320 minutes). + */ arc_3_days = 3, - /// Auto archive duration of 1 week. (10080 minutes) + + /** + * @brief Auto archive duration of 1 week (10080 minutes). + */ arc_1_week = 4, }; @@ -187,13 +316,24 @@ struct DPP_EXPORT thread_member : public json_interface { thread_member& fill_from_json_impl(nlohmann::json* j); public: - /// ID of the thread member is part of + /** + * @brief ID of the thread member is part of. + */ snowflake thread_id; - /// ID of the member + + /** + * @brief ID of the member. + */ snowflake user_id; - /// The time when user last joined the thread + + /** + * @brief The time when user last joined the thread. + */ time_t joined; - /// Any user-thread settings, currently only used for notifications + + /** + * @brief Any user-thread settings, currently only used for notifications. + */ uint32_t flags; }; @@ -220,11 +360,21 @@ struct DPP_EXPORT forum_tag : public managed, public json_interface { json to_json_impl(bool with_id = false) const; public: - /** The name of the tag (0-20 characters) */ + /** + * @brief The name of the tag (0-20 characters). + */ std::string name; - /** The emoji of the tag. Contains either nothing, the id of a guild's custom emoji or the unicode character of the emoji */ + + /** + * @brief The emoji of the tag. + * Contains either nothing, the id of a guild's custom emoji or the unicode character of the emoji. + */ std::variant emoji; - /** Whether this tag can only be added to or removed from threads by a member with the `MANAGE_THREADS` permission */ + + /** + * @brief Whether this tag can only be added to or removed from threads + * by a member with the `MANAGE_THREADS` permission. + */ bool moderated; /** Constructor */ @@ -280,50 +430,72 @@ class DPP_EXPORT channel : public managed, public json_interface { virtual json to_json_impl(bool with_id = false) const; public: - /** Channel name (1-100 characters) */ + /** + * @brief Channel name (1-100 characters). + */ std::string name; - /** Channel topic (0-4096 characters for forum and media channels, 0-1024 characters for all others) */ + /** + * @brief Channel topic (0-4096 characters for forum and media channels, 0-1024 characters for all others). + */ std::string topic; /** - * @brief Voice region if set for voice channel, otherwise empty string + * @brief Voice region if set for voice channel, otherwise empty string. */ std::string rtc_region; - /** DM recipients */ + /** + * @brief DM recipients. + */ std::vector recipients; - /** Permission overwrites to apply to base permissions */ + /** + * @brief Permission overwrites to apply to base permissions. + */ std::vector permission_overwrites; - /** A set of tags that can be used in a forum or media channel */ + /** + * @brief A set of tags that can be used in a forum or media channel. + */ std::vector available_tags; /** * @brief The emoji to show as the default reaction button on a thread in a forum or media channel. - * Contains either nothing, the id of a guild's custom emoji or the unicode character of the emoji + * Contains either nothing, the id of a guild's custom emoji or the unicode character of the emoji. */ std::variant default_reaction; /** - * @brief Channel icon (for group DMs) + * @brief Channel icon (for group DMs). */ utility::iconhash icon; - /** User ID of the creator for group DMs or threads */ + /** + * @brief User ID of the creator for group DMs or threads. + */ snowflake owner_id; - /** Parent ID (for guild channels: id of the parent category, for threads: id of the text channel this thread was created) */ + /** + * @brief Parent ID (for guild channels: id of the parent category, for threads: id of the text channel this thread was created). + */ snowflake parent_id; - /** Guild id of the guild that owns the channel */ + /** + * @brief Guild id of the guild that owns the channel. + */ snowflake guild_id; - /** ID of last message to be sent to the channel (may not point to an existing or valid message or thread) */ + /** + * @brief ID of last message to be sent to the channel. + * + * @warning may not point to an existing or valid message/thread. + */ snowflake last_message_id; - /** Timestamp of last pinned message */ + /** + * @brief Timestamp of last pinned message. + */ time_t last_pin_timestamp; /** @@ -334,31 +506,47 @@ class DPP_EXPORT channel : public managed, public json_interface { */ permission permissions; - /** Sorting position, lower number means higher up the list */ + /** + * @brief Sorting position, lower number means higher up the list + */ uint16_t position; - /** the bitrate (in kilobits) of the voice channel */ + /** + * @brief The bitrate (in kilobits) of the voice channel. + */ uint16_t bitrate; - /** amount of seconds a user has to wait before sending another message (0-21600); bots, as well as users with the permission manage_messages or manage_channel, are unaffected*/ + /** + * @brief Amount of seconds a user has to wait before sending another message (0-21600). + * Bots, as well as users with the permission manage_messages or manage_channel, are unaffected + */ uint16_t rate_limit_per_user; - /** The initial `rate_limit_per_user` to set on newly created threads in a channel. This field is copied to the thread at creation time and does not live update */ + /** + * @brief The initial `rate_limit_per_user` to set on newly created threads in a channel. + * This field is copied to the thread at creation time and does not live update. + */ uint16_t default_thread_rate_limit_per_user; /** * @brief Default duration, copied onto newly created threads. Used by the clients, not the API. - * Threads will stop showing in the channel list after the specified period of inactivity. Defaults to dpp::arc_1_day + * Threads will stop showing in the channel list after the specified period of inactivity. Defaults to dpp::arc_1_day. */ auto_archive_duration_t default_auto_archive_duration; - /** the default sort order type used to order posts in forum and media channels */ + /** + * @brief The default sort order type used to order posts in forum and media channels. + */ default_forum_sort_order_t default_sort_order; - /** Flags bitmap (dpp::channel_flags) */ + /** + * @brief Flags bitmap (dpp::channel_flags) + */ uint16_t flags; - /** Maximum user limit for voice channels (0-99) */ + /** + * @brief Maximum user limit for voice channels (0-99) + */ uint8_t user_limit; /** Constructor */ @@ -781,14 +969,18 @@ class DPP_EXPORT thread : public channel, public json_interface { */ thread_member member; - /** Thread metadata (threads) */ + /** + * @brief Thread metadata (threads) + */ thread_metadata metadata; - /** Created message. Only filled within the cluster::thread_create_in_forum() method */ + /** + * @brief Created message. Only filled within the cluster::thread_create_in_forum() method + */ message msg; /** - * A list of dpp::forum_tag IDs that have been applied to a thread in a forum or media channel + * @brief A list of dpp::forum_tag IDs that have been applied to a thread in a forum or media channel. */ std::vector applied_tags; @@ -804,7 +996,9 @@ class DPP_EXPORT thread : public channel, public json_interface { */ uint8_t message_count; - /** Approximate count of members in a thread (stops counting at 50) */ + /** + * @brief Approximate count of members in a thread (stops counting at 50) + */ uint8_t member_count; /** diff --git a/include/dpp/collector.h b/include/dpp/collector.h index 4e388971c4..ac09bf95a6 100644 --- a/include/dpp/collector.h +++ b/include/dpp/collector.h @@ -55,14 +55,24 @@ namespace dpp { template class collector { protected: - /// Owning cluster + /** + * @brief Owning cluster. + */ class cluster* owner; private: - /// Timed listener + /** + * @brief Timed listener. + */ timed_listener, std::function>* tl; - /// stored list + + /** + * @brief Stored list. + */ std::vector stored; - /// Trigger flag + + /** + * @brief Trigger flag. + */ bool triggered; public: /** @@ -153,17 +163,34 @@ template class collector */ class collected_reaction : public managed { public: - /// Reacting user + /** + * @brief Reacting user. + */ user react_user; - /// Reacting guild + + /** + * @brief Reacting guild. + */ guild* react_guild{}; - /// Reacting guild member + + /** + * @brief Reacting guild member. + */ guild_member react_member; - /// Reacting channel + + /** + * @brief Reacting channel. + */ channel* react_channel{}; - /// Reacted emoji + + /** + * @brief Reacted emoji. + */ emoji react_emoji; - /// ID of the user who authored the message which was reacted to (Optional) + + /** + * @brief Optional: ID of the user who authored the message which was reacted to. + */ snowflake message_author_id{}; }; @@ -239,7 +266,14 @@ class message_collector : public message_collector_t { * Collects message reactions during a set timeframe and returns them in a list via the completed() method. */ class reaction_collector : public reaction_collector_t { + /** + * @brief The ID of the message. + */ snowflake message_id; + + /** + * @brief The reaction. + */ collected_reaction react; public: /** diff --git a/include/dpp/colors.h b/include/dpp/colors.h index d5f642402a..7a2c90b957 100644 --- a/include/dpp/colors.h +++ b/include/dpp/colors.h @@ -22,723 +22,724 @@ #include - /** - * @brief The main namespace for D++ functions. classes and types +/** + * @brief The main namespace for D++ functions. classes and types */ namespace dpp { - /** - * @brief predefined color constants - */ - namespace colors { - const uint32_t - white = 0xFFFFFF, - discord_white = 0xFFFFFE, - light_gray = 0xC0C0C0, - gray = 0x808080, - dark_gray = 0x404040, - black = 0x000000, - discord_black = 0x000001, - red = 0xFF0000, - pink = 0xFFAFAF, - orange = 0xFFC800, - yellow = 0xFFFF00, - green = 0x00FF00, - magenta = 0xFF00FF, - cyan = 0x00FFFF, - blue = 0x0000FF, - light_sea_green = 0x1ABC9C, - medium_sea_green = 0x2ECC71, - summer_sky = 0x3498DB, - deep_lilac = 0x9B59B6, - ruby = 0xE91E63, - moon_yellow = 0xF1C40F, - tahiti_gold = 0xE67E22, - cinnabar = 0xE74C3C, - submarine = 0x95A5A6, - blue_aquamarine = 0x607D8B, - deep_sea = 0x11806A, - sea_green = 0x1F8B4C, - endeavour = 0x206694, - vivid_violet = 0x71368A, - jazzberry_jam = 0xAD1457, - dark_goldenrod = 0xC27C0E, - rust = 0xA84300, - brown = 0x992D22, - gray_chateau = 0x979C9F, - bismark = 0x546E7A, - sti_blue = 0x0E4BEF, - wrx_blue = 0x00247D, - rallyart_crimson = 0xE60012, - lime = 0x00FF00, - forest_green = 0x228B22, - cadmium_green = 0x097969, - aquamarine = 0x7FFFD4, - blue_green = 0x088F8F, - raspberry = 0xE30B5C, - scarlet_red = 0xFF2400, - night = 0x0C090A, - charcoal = 0x34282C, - oil = 0x3B3131, - light_black = 0x454545, - black_cat = 0x413839, - iridium = 0x3D3C3A, - black_eel = 0x463E3F, - black_cow = 0x4C4646, - gray_wolf = 0x504A4B, - grey_wolf = 0x504A4B, - vampire_gray = 0x565051, - vampire_grey = 0x565051, - iron_gray = 0x52595D, - iron_grey = 0x52595D, - gray_dolphin = 0x5C5858, - grey_dolphin = 0x5C5858, - carbon_gray = 0x625D5D, - carbon_grey = 0x625D5D, - ash_gray = 0x666362, - ash_grey = 0x666362, - dim_gray = 0x696969, - dim_grey = 0x696969, - nardo_gray = 0x686A6C, - nardo_grey = 0x686A6C, - cloudy_gray = 0x6D6968, - cloudy_grey = 0x6D6968, - smokey_gray = 0x726E6D, - smokey_grey = 0x726E6D, - alien_gray = 0x736F6E, - alien_grey = 0x736F6E, - sonic_silver = 0x757575, - platinum_gray = 0x797979, - platinum_grey = 0x797979, - granite = 0x837E7C, - battleship_gray = 0x848482, - battleship_grey = 0x848482, - gunmetal_gray = 0x8D918D, - gunmetal_grey = 0x8D918D, - gray_cloud = 0xB6B6B4, - grey_cloud = 0xB6B6B4, - silver = 0xC0C0C0, - pale_silver = 0xC9C0BB, - gray_goose = 0xD1D0CE, - grey_goose = 0xD1D0CE, - platinum_silver = 0xCECECE, - silver_white = 0xDADBDD, - gainsboro = 0xDCDCDC, - platinum = 0xE5E4E2, - metallic_silver = 0xBCC6CC, - blue_gray = 0x98AFC7, - blue_grey = 0x98AFC7, - roman_silver = 0x838996, - light_slate_gray = 0x778899, - light_slate_grey = 0x778899, - slate_gray = 0x708090, - slate_grey = 0x708090, - rat_gray = 0x6D7B8D, - slate_granite_gray = 0x657383, - slate_granite_grey = 0x657383, - jet_gray = 0x616D7E, - jet_grey = 0x616D7E, - mist_blue = 0x646D7E, - marble_blue = 0x566D7E, - slate_blue_grey = 0x737CA1, - slate_blue_gray = 0x737CA1, - light_purple_blue = 0x728FCE, - azure_blue = 0x4863A0, - blue_jay = 0x2B547E, - charcoal_blue = 0x36454F, - dark_blue_grey = 0x29465B, - dark_slate = 0x2B3856, - deep_sea_blue = 0x123456, - night_blue = 0x151B54, - midnight_blue = 0x191970, - navy = 0x000080, - denim_dark_blue = 0x151B8D, - dark_blue = 0x00008B, - lapis_blue = 0x15317E, - new_midnight_blue = 0x0000A0, - earth_blue = 0x0000A5, - cobalt_blue = 0x0020C2, - medium_blue = 0x0000CD, - blueberry_blue = 0x0041C2, - canary_blue = 0x2916F5, - samco_blue = 0x0002FF, - bright_blue = 0x0909FF, - blue_orchid = 0x1F45FC, - sapphire_blue = 0x2554C7, - blue_eyes = 0x1569C7, - bright_navy_blue = 0x1974D2, - balloon_blue = 0x2B60DE, - royal_blue = 0x4169E1, - ocean_blue = 0x2B65EC, - blue_ribbon = 0x306EFF, - blue_dress = 0x157DEC, - neon_blue = 0x1589FF, - dodger_blue = 0x1E90FF, - glacial_blue_ice = 0x368BC1, - steel_blue = 0x4682B4, - silk_blue = 0x488AC7, - windows_blue = 0x357EC7, - blue_ivy = 0x3090C7, - blue_koi = 0x659EC7, - columbia_blue = 0x87AFC7, - baby_blue = 0x95B9C7, - cornflower_blue = 0x6495ED, - sky_blue_dress = 0x6698FF, - iceberg = 0x56A5EC, - butterfly_blue = 0x38ACEC, - deep_sky_blue = 0x00BFFF, - midday_blue = 0x3BB9FF, - crystal_blue = 0x5CB3FF, - denim_blue = 0x79BAEC, - day_sky_blue = 0x82CAFF, - light_sky_blue = 0x87CEFA, - sky_blue = 0x87CEEB, - jeans_blue = 0xA0CFEC, - blue_angel = 0xB7CEEC, - pastel_blue = 0xB4CFEC, - light_day_blue = 0xADDFFF, - sea_blue = 0xC2DFFF, - heavenly_blue = 0xC6DEFF, - robin_egg_blue = 0xBDEDFF, - powder_blue = 0xB0E0E6, - coral_blue = 0xAFDCEC, - light_blue = 0xADD8E6, - light_steel_blue = 0xB0CFDE, - gulf_blue = 0xC9DFEC, - pastel_light_blue = 0xD5D6EA, - lavender_blue = 0xE3E4FA, - white_blue = 0xDBE9FA, - lavender = 0xE6E6FA, - water = 0xEBF4FA, - alice_blue = 0xF0F8FF, - ghost_white = 0xF8F8FF, - azure = 0xF0FFFF, - light_cyan = 0xE0FFFF, - light_slate = 0xCCFFFF, - electric_blue = 0x9AFEFF, - tron_blue = 0x7DFDFE, - blue_zircon = 0x57FEFF, - aqua = 0x00FFFF, - bright_cyan = 0x0AFFFF, - celeste = 0x50EBEC, - blue_diamond = 0x4EE2EC, - bright_turquoise = 0x16E2F5, - blue_lagoon = 0x8EEBEC, - pale_turquoise = 0xAFEEEE, - pale_blue_lily = 0xCFECEC, - light_teal = 0xB3D9D9, - tiffany_blue = 0x81D8D0, - blue_hosta = 0x77BFC7, - cyan_opaque = 0x92C7C7, - northern_lights_blue = 0x78C7C7, - medium_aquamarine = 0x66CDAA, - magic_mint = 0xAAF0D1, - light_aquamarine = 0x93FFE8, - bright_teal = 0x01F9C6, - turquoise = 0x40E0D0, - medium_turquoise = 0x48D1CC, - deep_turquoise = 0x48CCCD, - jellyfish = 0x46C7C7, - blue_turquoise = 0x43C6DB, - dark_turquoise = 0x00CED1, - macaw_blue_green = 0x43BFC7, - seafoam_green = 0x3EA99F, - cadet_blue = 0x5F9EA0, - blue_chill = 0x3B9C9C, - dark_cyan = 0x008B8B, - teal_green = 0x00827F, - teal = 0x008080, - teal_blue = 0x007C80, - medium_teal = 0x045F5F, - dark_teal = 0x045D5D, - deep_teal = 0x033E3E, - dark_slate_gray = 0x25383C, - dark_slate_grey = 0x25383C, - gunmetal = 0x2C3539, - blue_moss_green = 0x3C565B, - beetle_green = 0x4C787E, - grayish_turquoise = 0x5E7D7E, - greenish_blue = 0x307D7E, - aquamarine_stone = 0x348781, - sea_turtle_green = 0x438D80, - dull_sea_green = 0x4E8975, - dark_green_blue = 0x1F6357, - deep_sea_green = 0x306754, - bottle_green = 0x006A4E, - elf_green = 0x1B8A6B, - dark_mint = 0x31906E, - jade = 0x00A36C, - earth_green = 0x34A56F, - chrome_green = 0x1AA260, - emerald = 0x50C878, - mint = 0x3EB489, - metallic_green = 0x7C9D8E, - camouflage_green = 0x78866B, - sage_green = 0x848B79, - hazel_green = 0x617C58, - venom_green = 0x728C00, - olive_drab = 0x6B8E23, - olive = 0x808000, - dark_olive_green = 0x556B2F, - military_green = 0x4E5B31, - green_leaves = 0x3A5F0B, - army_green = 0x4B5320, - fern_green = 0x667C26, - fall_forest_green = 0x4E9258, - irish_green = 0x08A04B, - pine_green = 0x387C44, - medium_forest_green = 0x347235, - jungle_green = 0x347C2C, - cactus_green = 0x227442, - dark_green = 0x006400, - deep_green = 0x056608, - deep_emerald_green = 0x046307, - hunter_green = 0x355E3B, - dark_forest_green = 0x254117, - lotus_green = 0x004225, - seaweed_green = 0x437C17, - shamrock_green = 0x347C17, - green_onion = 0x6AA121, - moss_green = 0x8A9A5B, - grass_green = 0x3F9B0B, - green_pepper = 0x4AA02C, - dark_lime_green = 0x41A317, - parrot_green = 0x12AD2B, - clover_green = 0x3EA055, - dinosaur_green = 0x73A16C, - green_snake = 0x6CBB3C, - alien_green = 0x6CC417, - green_apple = 0x4CC417, - lime_green = 0x32CD32, - pea_green = 0x52D017, - kelly_green = 0x4CC552, - zombie_green = 0x54C571, - green_peas = 0x89C35C, - dollar_bill_green = 0x85BB65, - frog_green = 0x99C68E, - turquoise_green = 0xA0D6B4, - dark_sea_green = 0x8FBC8F, - basil_green = 0x829F82, - gray_green = 0xA2AD9C, - iguana_green = 0x9CB071, - citron_green = 0x8FB31D, - acid_green = 0xB0BF1A, - avocado_green = 0xB2C248, - pistachio_green = 0x9DC209, - salad_green = 0xA1C935, - yellow_green = 0x9ACD32, - pastel_green = 0x77DD77, - hummingbird_green = 0x7FE817, - nebula_green = 0x59E817, - stoplight_go_green = 0x57E964, - neon_green = 0x16F529, - jade_green = 0x5EFB6E, - lime_mint_green = 0x36F57F, - spring_green = 0x00FF7F, - medium_spring_green = 0x00FA9A, - emerald_green = 0x5FFB17, - lawn_green = 0x7CFC00, - bright_green = 0x66FF00, - chartreuse = 0x7FFF00, - yellow_lawn_green = 0x87F717, - aloe_vera_green = 0x98F516, - dull_green_yellow = 0xB1FB17, - lemon_green = 0xADF802, - green_yellow = 0xADFF2F, - chameleon_green = 0xBDF516, - neon_yellow_green = 0xDAEE01, - yellow_green_grosbeak = 0xE2F516, - tea_green = 0xCCFB5D, - slime_green = 0xBCE954, - algae_green = 0x64E986, - light_green = 0x90EE90, - dragon_green = 0x6AFB92, - pale_green = 0x98FB98, - mint_green = 0x98FF98, - green_thumb = 0xB5EAAA, - organic_brown = 0xE3F9A6, - light_jade = 0xC3FDB8, - light_mint_green = 0xC2E5D3, - light_rose_green = 0xDBF9DB, - chrome_white = 0xE8F1D4, - honeydew = 0xF0FFF0, - mint_cream = 0xF5FFFA, - lemon_chiffon = 0xFFFACD, - parchment = 0xFFFFC2, - cream = 0xFFFFCC, - cream_white = 0xFFFDD0, - light_goldenrod_yellow = 0xFAFAD2, - light_yellow = 0xFFFFE0, - beige = 0xF5F5DC, - cornsilk = 0xFFF8DC, - blonde = 0xFBF6D9, - champagne = 0xF7E7CE, - antique_white = 0xFAEBD7, - papaya_whip = 0xFFEFD5, - blanched_almond = 0xFFEBCD, - bisque = 0xFFE4C4, - wheat = 0xF5DEB3, - moccasin = 0xFFE4B5, - peach = 0xFFE5B4, - light_orange = 0xFED8B1, - peach_puff = 0xFFDAB9, - coral_peach = 0xFBD5AB, - navajo_white = 0xFFDEAD, - golden_blonde = 0xFBE7A1, - golden_silk = 0xF3E3C3, - dark_blonde = 0xF0E2B6, - light_gold = 0xF1E5AC, - vanilla = 0xF3E5AB, - tan_brown = 0xECE5B6, - dirty_white = 0xE8E4C9, - pale_goldenrod = 0xEEE8AA, - khaki = 0xF0E68C, - cardboard_brown = 0xEDDA74, - harvest_gold = 0xEDE275, - sun_yellow = 0xFFE87C, - corn_yellow = 0xFFF380, - pastel_yellow = 0xFAF884, - neon_yellow = 0xFFFF33, - canary_yellow = 0xFFEF00, - banana_yellow = 0xF5E216, - mustard_yellow = 0xFFDB58, - golden_yellow = 0xFFDF00, - bold_yellow = 0xF9DB24, - rubber_ducky_yellow = 0xFFD801, - gold = 0xFFD700, - bright_gold = 0xFDD017, - chrome_gold = 0xFFCE44, - golden_brown = 0xEAC117, - deep_yellow = 0xF6BE00, - macaroni_and_cheese = 0xF2BB66, - saffron = 0xFBB917, - neon_gold = 0xFDBD01, - beer = 0xFBB117, - yellow_orange = 0xFFAE42, - orange_yellow = 0xFFAE42, - cantaloupe = 0xFFA62F, - cheese_orange = 0xFFA600, - brown_sand = 0xEE9A4D, - sandy_brown = 0xF4A460, - brown_sugar = 0xE2A76F, - camel_brown = 0xC19A6B, - deer_brown = 0xE6BF83, - burly_wood = 0xDEB887, - tan = 0xD2B48C, - light_french_beige = 0xC8AD7F, - sand = 0xC2B280, - sage = 0xBCB88A, - fall_leaf_brown = 0xC8B560, - ginger_brown = 0xC9BE62, - bronze_gold = 0xC9AE5D, - dark_khaki = 0xBDB76B, - olive_green = 0xBAB86C, - brass = 0xB5A642, - cookie_brown = 0xC7A317, - metallic_gold = 0xD4AF37, - bee_yellow = 0xE9AB17, - school_bus_yellow = 0xE8A317, - goldenrod = 0xDAA520, - orange_gold = 0xD4A017, - caramel = 0xC68E17, - cinnamon = 0xC58917, - peru = 0xCD853F, - bronze = 0xCD7F32, - tiger_orange = 0xC88141, - copper = 0xB87333, - dark_gold = 0xAA6C39, - metallic_bronze = 0xA97142, - dark_almond = 0xAB784E, - wood = 0x966F33, - oak_brown = 0x806517, - antique_bronze = 0x665D1E, - hazel = 0x8E7618, - dark_yellow = 0x8B8000, - dark_moccasin = 0x827839, - khaki_green = 0x8A865D, - millennium_jade = 0x93917C, - dark_beige = 0x9F8C76, - bullet_shell = 0xAF9B60, - army_brown = 0x827B60, - sandstone = 0x786D5F, - taupe = 0x483C32, - mocha = 0x493D26, - milk_chocolate = 0x513B1C, - gray_brown = 0x3D3635, - dark_coffee = 0x3B2F2F, - old_burgundy = 0x43302E, - western_charcoal = 0x49413F, - bakers_brown = 0x5C3317, - dark_brown = 0x654321, - sepia_brown = 0x704214, - dark_bronze = 0x804A00, - coffee = 0x6F4E37, - brown_bear = 0x835C3B, - red_dirt = 0x7F5217, - sepia = 0x7F462C, - sienna = 0xA0522D, - saddle_brown = 0x8B4513, - dark_sienna = 0x8A4117, - sangria = 0x7E3817, - blood_red = 0x7E3517, - chestnut = 0x954535, - coral_brown = 0x9E4638, - chestnut_red = 0xC34A2C, - mahogany = 0xC04000, - red_gold = 0xEB5406, - red_fox = 0xC35817, - dark_bisque = 0xB86500, - light_brown = 0xB5651D, - petra_gold = 0xB76734, - copper_red = 0xCB6D51, - orange_salmon = 0xC47451, - chocolate = 0xD2691E, - sedona = 0xCC6600, - papaya_orange = 0xE56717, - halloween_orange = 0xE66C2C, - neon_orange = 0xFF6700, - bright_orange = 0xFF5F1F, - pumpkin_orange = 0xF87217, - carrot_orange = 0xF88017, - dark_orange = 0xFF8C00, - construction_cone_orange = 0xF87431, - indian_saffron = 0xFF7722, - sunrise_orange = 0xE67451, - mango_orange = 0xFF8040, - coral = 0xFF7F50, - basket_ball_orange = 0xF88158, - light_salmon_rose = 0xF9966B, - light_salmon = 0xFFA07A, - dark_salmon = 0xE9967A, - tangerine = 0xE78A61, - light_copper = 0xDA8A67, - salmon_pink = 0xFF8674, - salmon = 0xFA8072, - peach_pink = 0xF98B88, - light_coral = 0xF08080, - pastel_red = 0xF67280, - pink_coral = 0xE77471, - bean_red = 0xF75D59, - valentine_red = 0xE55451, - indian_red = 0xCD5C5C, - tomato = 0xFF6347, - shocking_orange = 0xE55B3C, - orange_red = 0xFF4500, - neon_red = 0xFD1C03, - ruby_red = 0xF62217, - ferrari_red = 0xF70D1A, - fire_engine_red = 0xF62817, - lava_red = 0xE42217, - love_red = 0xE41B17, - grapefruit = 0xDC381F, - cherry_red = 0xC24641, - chilli_pepper = 0xC11B17, - fire_brick = 0xB22222, - tomato_sauce_red = 0xB21807, - carbon_red = 0xA70D2A, - cranberry = 0x9F000F, - saffron_red = 0x931314, - crimson_red = 0x990000, - red_wine = 0x990012, - wine_red = 0x990012, - dark_red = 0x8B0000, - maroon = 0x800000, - burgundy = 0x8C001A, - vermilion = 0x7E191B, - deep_red = 0x800517, - red_blood = 0x660000, - blood_night = 0x551606, - dark_scarlet = 0x560319, - black_bean = 0x3D0C02, - chocolate_brown = 0x3F000F, - midnight = 0x2B1B17, - purple_lily = 0x550A35, - purple_maroon = 0x810541, - plum_pie = 0x7D0541, - plum_velvet = 0x7D0552, - dark_raspberry = 0x872657, - velvet_maroon = 0x7E354D, - rosy_finch = 0x7F4E52, - dull_purple = 0x7F525D, - puce = 0x7F5A58, - rose_dust = 0x997070, - pastel_brown = 0xB1907F, - rosy_pink = 0xB38481, - rosy_brown = 0xBC8F8F, - khaki_rose = 0xC5908E, - lipstick_pink = 0xC48793, - pink_brown = 0xC48189, - old_rose = 0xC08081, - dusty_pink = 0xD58A94, - pink_daisy = 0xE799A3, - rose = 0xE8ADAA, - dusty_rose = 0xC9A9A6, - silver_pink = 0xC4AEAD, - gold_pink = 0xE6C7C2, - rose_gold = 0xECC5C0, - deep_peach = 0xFFCBA4, - pastel_orange = 0xF8B88B, - desert_sand = 0xEDC9AF, - unbleached_silk = 0xFFDDCA, - pig_pink = 0xFDD7E4, - pale_pink = 0xF2D4D7, - blush = 0xFFE6E8, - misty_rose = 0xFFE4E1, - pink_bubble_gum = 0xFFDFDD, - light_rose = 0xFBCFCD, - light_red = 0xFFCCCB, - warm_pink = 0xF6C6BD, - deep_rose = 0xFBBBB9, - light_pink = 0xFFB6C1, - soft_pink = 0xFFB8BF, - donut_pink = 0xFAAFBE, - baby_pink = 0xFAAFBA, - flamingo_pink = 0xF9A7B0, - pastel_pink = 0xFEA3AA, - rose_pink = 0xE7A1B0, - pink_rose = 0xE7A1B0, - cadillac_pink = 0xE38AAE, - carnation_pink = 0xF778A1, - pastel_rose = 0xE5788F, - blush_red = 0xE56E94, - pale_violet_red = 0xDB7093, - purple_pink = 0xD16587, - tulip_pink = 0xC25A7C, - bashful_pink = 0xC25283, - dark_pink = 0xE75480, - dark_hot_pink = 0xF660AB, - hot_pink = 0xFF69B4, - watermelon_pink = 0xFC6C85, - violet_red = 0xF6358A, - hot_deep_pink = 0xF52887, - bright_pink = 0xFF007F, - deep_pink = 0xFF1493, - neon_pink = 0xF535AA, - chrome_pink = 0xFF33AA, - neon_hot_pink = 0xFD349C, - pink_cupcake = 0xE45E9D, - royal_pink = 0xE759AC, - dimorphotheca_magenta = 0xE3319D, - pink_lemonade = 0xE4287C, - red_pink = 0xFA2A55, - crimson = 0xDC143C, - bright_maroon = 0xC32148, - rose_red = 0xC21E56, - rogue_pink = 0xC12869, - burnt_pink = 0xC12267, - pink_violet = 0xCA226B, - magenta_pink = 0xCC338B, - medium_violet_red = 0xC71585, - dark_carnation_pink = 0xC12283, - raspberry_purple = 0xB3446C, - pink_plum = 0xB93B8F, - orchid = 0xDA70D6, - deep_mauve = 0xDF73D4, - violet = 0xEE82EE, - fuchsia_pink = 0xFF77FF, - bright_neon_pink = 0xF433FF, - fuchsia = 0xFF00FF, - crimson_purple = 0xE238EC, - heliotrope_purple = 0xD462FF, - tyrian_purple = 0xC45AEC, - medium_orchid = 0xBA55D3, - purple_flower = 0xA74AC7, - orchid_purple = 0xB048B5, - rich_lilac = 0xB666D2, - pastel_violet = 0xD291BC, - mauve_taupe = 0x915F6D, - viola_purple = 0x7E587E, - eggplant = 0x614051, - plum_purple = 0x583759, - grape = 0x5E5A80, - purple_navy = 0x4E5180, - slate_blue = 0x6A5ACD, - blue_lotus = 0x6960EC, - blurple = 0x5865F2, - light_slate_blue = 0x736AFF, - medium_slate_blue = 0x7B68EE, - periwinkle_purple = 0x7575CF, - very_peri = 0x6667AB, - bright_grape = 0x6F2DA8, - purple_amethyst = 0x6C2DC7, - bright_purple = 0x6A0DAD, - deep_periwinkle = 0x5453A6, - dark_slate_blue = 0x483D8B, - purple_haze = 0x4E387E, - purple_iris = 0x571B7E, - dark_purple = 0x4B0150, - deep_purple = 0x36013F, - midnight_purple = 0x2E1A47, - purple_monster = 0x461B7E, - indigo = 0x4B0082, - blue_whale = 0x342D7E, - rebecca_purple = 0x663399, - purple_jam = 0x6A287E, - dark_magenta = 0x8B008B, - purple = 0x800080, - french_lilac = 0x86608E, - dark_orchid = 0x9932CC, - dark_violet = 0x9400D3, - purple_violet = 0x8D38C9, - jasmine_purple = 0xA23BEC, - purple_daffodil = 0xB041FF, - clematis_violet = 0x842DCE, - blue_violet = 0x8A2BE2, - purple_sage_bush = 0x7A5DC7, - lovely_purple = 0x7F38EC, - neon_purple = 0x9D00FF, - purple_plum = 0x8E35EF, - aztech_purple = 0x893BFF, - medium_purple = 0x9370DB, - light_purple = 0x8467D7, - crocus_purple = 0x9172EC, - purple_mimosa = 0x9E7BFF, - periwinkle = 0xCCCCFF, - pale_lilac = 0xDCD0FF, - lavender_purple = 0x967BB6, - rose_purple = 0xB09FCA, - lilac = 0xC8A2C8, - mauve = 0xE0B0FF, - bright_lilac = 0xD891EF, - purple_dragon = 0xC38EC7, - plum = 0xDDA0DD, - blush_pink = 0xE6A9EC, - pastel_purple = 0xF2A2E8, - blossom_pink = 0xF9B7FF, - wisteria_purple = 0xC6AEC7, - purple_thistle = 0xD2B9D3, - thistle = 0xD8BFD8, - purple_white = 0xDFD3E3, - periwinkle_pink = 0xE9CFEC, - cotton_candy = 0xFCDFFF, - lavender_pinocchio = 0xEBDDE2, - dark_white = 0xE1D9D1, - ash_white = 0xE9E4D4, - white_chocolate = 0xEDE6D6, - soft_ivory = 0xFAF0DD, - off_white = 0xF8F0E3, - pearl_white = 0xF8F6F0, - red_white = 0xF3E8EA, - lavender_blush = 0xFFF0F5, - pearl = 0xFDEEF4, - egg_shell = 0xFFF9E3, - old_lace = 0xFEF0E3, - linen = 0xFAF0E6, - sea_shell = 0xFFF5EE, - bone_white = 0xF9F6EE, - rice = 0xFAF5EF, - floral_white = 0xFFFAF0, - ivory = 0xFFFFF0, - white_gold = 0xFFFFF4, - light_white = 0xFFFFF7, - white_smoke = 0xF5F5F5, - cotton = 0xFBFBF9, - snow = 0xFFFAFA, - milk_white = 0xFEFCFF, - half_white = 0xFFFEFA; - } // namespace colors - /** - * @brief predefined color constants, same as colors - */ - namespace colours = colors; +/** + * @brief predefined color constants. + */ +namespace colors { + const uint32_t + white = 0xFFFFFF, + discord_white = 0xFFFFFE, + light_gray = 0xC0C0C0, + gray = 0x808080, + dark_gray = 0x404040, + black = 0x000000, + discord_black = 0x000001, + red = 0xFF0000, + pink = 0xFFAFAF, + orange = 0xFFC800, + yellow = 0xFFFF00, + green = 0x00FF00, + magenta = 0xFF00FF, + cyan = 0x00FFFF, + blue = 0x0000FF, + light_sea_green = 0x1ABC9C, + medium_sea_green = 0x2ECC71, + summer_sky = 0x3498DB, + deep_lilac = 0x9B59B6, + ruby = 0xE91E63, + moon_yellow = 0xF1C40F, + tahiti_gold = 0xE67E22, + cinnabar = 0xE74C3C, + submarine = 0x95A5A6, + blue_aquamarine = 0x607D8B, + deep_sea = 0x11806A, + sea_green = 0x1F8B4C, + endeavour = 0x206694, + vivid_violet = 0x71368A, + jazzberry_jam = 0xAD1457, + dark_goldenrod = 0xC27C0E, + rust = 0xA84300, + brown = 0x992D22, + gray_chateau = 0x979C9F, + bismark = 0x546E7A, + sti_blue = 0x0E4BEF, + wrx_blue = 0x00247D, + rallyart_crimson = 0xE60012, + lime = 0x00FF00, + forest_green = 0x228B22, + cadmium_green = 0x097969, + aquamarine = 0x7FFFD4, + blue_green = 0x088F8F, + raspberry = 0xE30B5C, + scarlet_red = 0xFF2400, + night = 0x0C090A, + charcoal = 0x34282C, + oil = 0x3B3131, + light_black = 0x454545, + black_cat = 0x413839, + iridium = 0x3D3C3A, + black_eel = 0x463E3F, + black_cow = 0x4C4646, + gray_wolf = 0x504A4B, + grey_wolf = 0x504A4B, + vampire_gray = 0x565051, + vampire_grey = 0x565051, + iron_gray = 0x52595D, + iron_grey = 0x52595D, + gray_dolphin = 0x5C5858, + grey_dolphin = 0x5C5858, + carbon_gray = 0x625D5D, + carbon_grey = 0x625D5D, + ash_gray = 0x666362, + ash_grey = 0x666362, + dim_gray = 0x696969, + dim_grey = 0x696969, + nardo_gray = 0x686A6C, + nardo_grey = 0x686A6C, + cloudy_gray = 0x6D6968, + cloudy_grey = 0x6D6968, + smokey_gray = 0x726E6D, + smokey_grey = 0x726E6D, + alien_gray = 0x736F6E, + alien_grey = 0x736F6E, + sonic_silver = 0x757575, + platinum_gray = 0x797979, + platinum_grey = 0x797979, + granite = 0x837E7C, + battleship_gray = 0x848482, + battleship_grey = 0x848482, + gunmetal_gray = 0x8D918D, + gunmetal_grey = 0x8D918D, + gray_cloud = 0xB6B6B4, + grey_cloud = 0xB6B6B4, + silver = 0xC0C0C0, + pale_silver = 0xC9C0BB, + gray_goose = 0xD1D0CE, + grey_goose = 0xD1D0CE, + platinum_silver = 0xCECECE, + silver_white = 0xDADBDD, + gainsboro = 0xDCDCDC, + platinum = 0xE5E4E2, + metallic_silver = 0xBCC6CC, + blue_gray = 0x98AFC7, + blue_grey = 0x98AFC7, + roman_silver = 0x838996, + light_slate_gray = 0x778899, + light_slate_grey = 0x778899, + slate_gray = 0x708090, + slate_grey = 0x708090, + rat_gray = 0x6D7B8D, + slate_granite_gray = 0x657383, + slate_granite_grey = 0x657383, + jet_gray = 0x616D7E, + jet_grey = 0x616D7E, + mist_blue = 0x646D7E, + marble_blue = 0x566D7E, + slate_blue_grey = 0x737CA1, + slate_blue_gray = 0x737CA1, + light_purple_blue = 0x728FCE, + azure_blue = 0x4863A0, + blue_jay = 0x2B547E, + charcoal_blue = 0x36454F, + dark_blue_grey = 0x29465B, + dark_slate = 0x2B3856, + deep_sea_blue = 0x123456, + night_blue = 0x151B54, + midnight_blue = 0x191970, + navy = 0x000080, + denim_dark_blue = 0x151B8D, + dark_blue = 0x00008B, + lapis_blue = 0x15317E, + new_midnight_blue = 0x0000A0, + earth_blue = 0x0000A5, + cobalt_blue = 0x0020C2, + medium_blue = 0x0000CD, + blueberry_blue = 0x0041C2, + canary_blue = 0x2916F5, + samco_blue = 0x0002FF, + bright_blue = 0x0909FF, + blue_orchid = 0x1F45FC, + sapphire_blue = 0x2554C7, + blue_eyes = 0x1569C7, + bright_navy_blue = 0x1974D2, + balloon_blue = 0x2B60DE, + royal_blue = 0x4169E1, + ocean_blue = 0x2B65EC, + blue_ribbon = 0x306EFF, + blue_dress = 0x157DEC, + neon_blue = 0x1589FF, + dodger_blue = 0x1E90FF, + glacial_blue_ice = 0x368BC1, + steel_blue = 0x4682B4, + silk_blue = 0x488AC7, + windows_blue = 0x357EC7, + blue_ivy = 0x3090C7, + blue_koi = 0x659EC7, + columbia_blue = 0x87AFC7, + baby_blue = 0x95B9C7, + cornflower_blue = 0x6495ED, + sky_blue_dress = 0x6698FF, + iceberg = 0x56A5EC, + butterfly_blue = 0x38ACEC, + deep_sky_blue = 0x00BFFF, + midday_blue = 0x3BB9FF, + crystal_blue = 0x5CB3FF, + denim_blue = 0x79BAEC, + day_sky_blue = 0x82CAFF, + light_sky_blue = 0x87CEFA, + sky_blue = 0x87CEEB, + jeans_blue = 0xA0CFEC, + blue_angel = 0xB7CEEC, + pastel_blue = 0xB4CFEC, + light_day_blue = 0xADDFFF, + sea_blue = 0xC2DFFF, + heavenly_blue = 0xC6DEFF, + robin_egg_blue = 0xBDEDFF, + powder_blue = 0xB0E0E6, + coral_blue = 0xAFDCEC, + light_blue = 0xADD8E6, + light_steel_blue = 0xB0CFDE, + gulf_blue = 0xC9DFEC, + pastel_light_blue = 0xD5D6EA, + lavender_blue = 0xE3E4FA, + white_blue = 0xDBE9FA, + lavender = 0xE6E6FA, + water = 0xEBF4FA, + alice_blue = 0xF0F8FF, + ghost_white = 0xF8F8FF, + azure = 0xF0FFFF, + light_cyan = 0xE0FFFF, + light_slate = 0xCCFFFF, + electric_blue = 0x9AFEFF, + tron_blue = 0x7DFDFE, + blue_zircon = 0x57FEFF, + aqua = 0x00FFFF, + bright_cyan = 0x0AFFFF, + celeste = 0x50EBEC, + blue_diamond = 0x4EE2EC, + bright_turquoise = 0x16E2F5, + blue_lagoon = 0x8EEBEC, + pale_turquoise = 0xAFEEEE, + pale_blue_lily = 0xCFECEC, + light_teal = 0xB3D9D9, + tiffany_blue = 0x81D8D0, + blue_hosta = 0x77BFC7, + cyan_opaque = 0x92C7C7, + northern_lights_blue = 0x78C7C7, + medium_aquamarine = 0x66CDAA, + magic_mint = 0xAAF0D1, + light_aquamarine = 0x93FFE8, + bright_teal = 0x01F9C6, + turquoise = 0x40E0D0, + medium_turquoise = 0x48D1CC, + deep_turquoise = 0x48CCCD, + jellyfish = 0x46C7C7, + blue_turquoise = 0x43C6DB, + dark_turquoise = 0x00CED1, + macaw_blue_green = 0x43BFC7, + seafoam_green = 0x3EA99F, + cadet_blue = 0x5F9EA0, + blue_chill = 0x3B9C9C, + dark_cyan = 0x008B8B, + teal_green = 0x00827F, + teal = 0x008080, + teal_blue = 0x007C80, + medium_teal = 0x045F5F, + dark_teal = 0x045D5D, + deep_teal = 0x033E3E, + dark_slate_gray = 0x25383C, + dark_slate_grey = 0x25383C, + gunmetal = 0x2C3539, + blue_moss_green = 0x3C565B, + beetle_green = 0x4C787E, + grayish_turquoise = 0x5E7D7E, + greenish_blue = 0x307D7E, + aquamarine_stone = 0x348781, + sea_turtle_green = 0x438D80, + dull_sea_green = 0x4E8975, + dark_green_blue = 0x1F6357, + deep_sea_green = 0x306754, + bottle_green = 0x006A4E, + elf_green = 0x1B8A6B, + dark_mint = 0x31906E, + jade = 0x00A36C, + earth_green = 0x34A56F, + chrome_green = 0x1AA260, + emerald = 0x50C878, + mint = 0x3EB489, + metallic_green = 0x7C9D8E, + camouflage_green = 0x78866B, + sage_green = 0x848B79, + hazel_green = 0x617C58, + venom_green = 0x728C00, + olive_drab = 0x6B8E23, + olive = 0x808000, + dark_olive_green = 0x556B2F, + military_green = 0x4E5B31, + green_leaves = 0x3A5F0B, + army_green = 0x4B5320, + fern_green = 0x667C26, + fall_forest_green = 0x4E9258, + irish_green = 0x08A04B, + pine_green = 0x387C44, + medium_forest_green = 0x347235, + jungle_green = 0x347C2C, + cactus_green = 0x227442, + dark_green = 0x006400, + deep_green = 0x056608, + deep_emerald_green = 0x046307, + hunter_green = 0x355E3B, + dark_forest_green = 0x254117, + lotus_green = 0x004225, + seaweed_green = 0x437C17, + shamrock_green = 0x347C17, + green_onion = 0x6AA121, + moss_green = 0x8A9A5B, + grass_green = 0x3F9B0B, + green_pepper = 0x4AA02C, + dark_lime_green = 0x41A317, + parrot_green = 0x12AD2B, + clover_green = 0x3EA055, + dinosaur_green = 0x73A16C, + green_snake = 0x6CBB3C, + alien_green = 0x6CC417, + green_apple = 0x4CC417, + lime_green = 0x32CD32, + pea_green = 0x52D017, + kelly_green = 0x4CC552, + zombie_green = 0x54C571, + green_peas = 0x89C35C, + dollar_bill_green = 0x85BB65, + frog_green = 0x99C68E, + turquoise_green = 0xA0D6B4, + dark_sea_green = 0x8FBC8F, + basil_green = 0x829F82, + gray_green = 0xA2AD9C, + iguana_green = 0x9CB071, + citron_green = 0x8FB31D, + acid_green = 0xB0BF1A, + avocado_green = 0xB2C248, + pistachio_green = 0x9DC209, + salad_green = 0xA1C935, + yellow_green = 0x9ACD32, + pastel_green = 0x77DD77, + hummingbird_green = 0x7FE817, + nebula_green = 0x59E817, + stoplight_go_green = 0x57E964, + neon_green = 0x16F529, + jade_green = 0x5EFB6E, + lime_mint_green = 0x36F57F, + spring_green = 0x00FF7F, + medium_spring_green = 0x00FA9A, + emerald_green = 0x5FFB17, + lawn_green = 0x7CFC00, + bright_green = 0x66FF00, + chartreuse = 0x7FFF00, + yellow_lawn_green = 0x87F717, + aloe_vera_green = 0x98F516, + dull_green_yellow = 0xB1FB17, + lemon_green = 0xADF802, + green_yellow = 0xADFF2F, + chameleon_green = 0xBDF516, + neon_yellow_green = 0xDAEE01, + yellow_green_grosbeak = 0xE2F516, + tea_green = 0xCCFB5D, + slime_green = 0xBCE954, + algae_green = 0x64E986, + light_green = 0x90EE90, + dragon_green = 0x6AFB92, + pale_green = 0x98FB98, + mint_green = 0x98FF98, + green_thumb = 0xB5EAAA, + organic_brown = 0xE3F9A6, + light_jade = 0xC3FDB8, + light_mint_green = 0xC2E5D3, + light_rose_green = 0xDBF9DB, + chrome_white = 0xE8F1D4, + honeydew = 0xF0FFF0, + mint_cream = 0xF5FFFA, + lemon_chiffon = 0xFFFACD, + parchment = 0xFFFFC2, + cream = 0xFFFFCC, + cream_white = 0xFFFDD0, + light_goldenrod_yellow = 0xFAFAD2, + light_yellow = 0xFFFFE0, + beige = 0xF5F5DC, + cornsilk = 0xFFF8DC, + blonde = 0xFBF6D9, + champagne = 0xF7E7CE, + antique_white = 0xFAEBD7, + papaya_whip = 0xFFEFD5, + blanched_almond = 0xFFEBCD, + bisque = 0xFFE4C4, + wheat = 0xF5DEB3, + moccasin = 0xFFE4B5, + peach = 0xFFE5B4, + light_orange = 0xFED8B1, + peach_puff = 0xFFDAB9, + coral_peach = 0xFBD5AB, + navajo_white = 0xFFDEAD, + golden_blonde = 0xFBE7A1, + golden_silk = 0xF3E3C3, + dark_blonde = 0xF0E2B6, + light_gold = 0xF1E5AC, + vanilla = 0xF3E5AB, + tan_brown = 0xECE5B6, + dirty_white = 0xE8E4C9, + pale_goldenrod = 0xEEE8AA, + khaki = 0xF0E68C, + cardboard_brown = 0xEDDA74, + harvest_gold = 0xEDE275, + sun_yellow = 0xFFE87C, + corn_yellow = 0xFFF380, + pastel_yellow = 0xFAF884, + neon_yellow = 0xFFFF33, + canary_yellow = 0xFFEF00, + banana_yellow = 0xF5E216, + mustard_yellow = 0xFFDB58, + golden_yellow = 0xFFDF00, + bold_yellow = 0xF9DB24, + rubber_ducky_yellow = 0xFFD801, + gold = 0xFFD700, + bright_gold = 0xFDD017, + chrome_gold = 0xFFCE44, + golden_brown = 0xEAC117, + deep_yellow = 0xF6BE00, + macaroni_and_cheese = 0xF2BB66, + saffron = 0xFBB917, + neon_gold = 0xFDBD01, + beer = 0xFBB117, + yellow_orange = 0xFFAE42, + orange_yellow = 0xFFAE42, + cantaloupe = 0xFFA62F, + cheese_orange = 0xFFA600, + brown_sand = 0xEE9A4D, + sandy_brown = 0xF4A460, + brown_sugar = 0xE2A76F, + camel_brown = 0xC19A6B, + deer_brown = 0xE6BF83, + burly_wood = 0xDEB887, + tan = 0xD2B48C, + light_french_beige = 0xC8AD7F, + sand = 0xC2B280, + sage = 0xBCB88A, + fall_leaf_brown = 0xC8B560, + ginger_brown = 0xC9BE62, + bronze_gold = 0xC9AE5D, + dark_khaki = 0xBDB76B, + olive_green = 0xBAB86C, + brass = 0xB5A642, + cookie_brown = 0xC7A317, + metallic_gold = 0xD4AF37, + bee_yellow = 0xE9AB17, + school_bus_yellow = 0xE8A317, + goldenrod = 0xDAA520, + orange_gold = 0xD4A017, + caramel = 0xC68E17, + cinnamon = 0xC58917, + peru = 0xCD853F, + bronze = 0xCD7F32, + tiger_orange = 0xC88141, + copper = 0xB87333, + dark_gold = 0xAA6C39, + metallic_bronze = 0xA97142, + dark_almond = 0xAB784E, + wood = 0x966F33, + oak_brown = 0x806517, + antique_bronze = 0x665D1E, + hazel = 0x8E7618, + dark_yellow = 0x8B8000, + dark_moccasin = 0x827839, + khaki_green = 0x8A865D, + millennium_jade = 0x93917C, + dark_beige = 0x9F8C76, + bullet_shell = 0xAF9B60, + army_brown = 0x827B60, + sandstone = 0x786D5F, + taupe = 0x483C32, + mocha = 0x493D26, + milk_chocolate = 0x513B1C, + gray_brown = 0x3D3635, + dark_coffee = 0x3B2F2F, + old_burgundy = 0x43302E, + western_charcoal = 0x49413F, + bakers_brown = 0x5C3317, + dark_brown = 0x654321, + sepia_brown = 0x704214, + dark_bronze = 0x804A00, + coffee = 0x6F4E37, + brown_bear = 0x835C3B, + red_dirt = 0x7F5217, + sepia = 0x7F462C, + sienna = 0xA0522D, + saddle_brown = 0x8B4513, + dark_sienna = 0x8A4117, + sangria = 0x7E3817, + blood_red = 0x7E3517, + chestnut = 0x954535, + coral_brown = 0x9E4638, + chestnut_red = 0xC34A2C, + mahogany = 0xC04000, + red_gold = 0xEB5406, + red_fox = 0xC35817, + dark_bisque = 0xB86500, + light_brown = 0xB5651D, + petra_gold = 0xB76734, + copper_red = 0xCB6D51, + orange_salmon = 0xC47451, + chocolate = 0xD2691E, + sedona = 0xCC6600, + papaya_orange = 0xE56717, + halloween_orange = 0xE66C2C, + neon_orange = 0xFF6700, + bright_orange = 0xFF5F1F, + pumpkin_orange = 0xF87217, + carrot_orange = 0xF88017, + dark_orange = 0xFF8C00, + construction_cone_orange = 0xF87431, + indian_saffron = 0xFF7722, + sunrise_orange = 0xE67451, + mango_orange = 0xFF8040, + coral = 0xFF7F50, + basket_ball_orange = 0xF88158, + light_salmon_rose = 0xF9966B, + light_salmon = 0xFFA07A, + dark_salmon = 0xE9967A, + tangerine = 0xE78A61, + light_copper = 0xDA8A67, + salmon_pink = 0xFF8674, + salmon = 0xFA8072, + peach_pink = 0xF98B88, + light_coral = 0xF08080, + pastel_red = 0xF67280, + pink_coral = 0xE77471, + bean_red = 0xF75D59, + valentine_red = 0xE55451, + indian_red = 0xCD5C5C, + tomato = 0xFF6347, + shocking_orange = 0xE55B3C, + orange_red = 0xFF4500, + neon_red = 0xFD1C03, + ruby_red = 0xF62217, + ferrari_red = 0xF70D1A, + fire_engine_red = 0xF62817, + lava_red = 0xE42217, + love_red = 0xE41B17, + grapefruit = 0xDC381F, + cherry_red = 0xC24641, + chilli_pepper = 0xC11B17, + fire_brick = 0xB22222, + tomato_sauce_red = 0xB21807, + carbon_red = 0xA70D2A, + cranberry = 0x9F000F, + saffron_red = 0x931314, + crimson_red = 0x990000, + red_wine = 0x990012, + wine_red = 0x990012, + dark_red = 0x8B0000, + maroon = 0x800000, + burgundy = 0x8C001A, + vermilion = 0x7E191B, + deep_red = 0x800517, + red_blood = 0x660000, + blood_night = 0x551606, + dark_scarlet = 0x560319, + black_bean = 0x3D0C02, + chocolate_brown = 0x3F000F, + midnight = 0x2B1B17, + purple_lily = 0x550A35, + purple_maroon = 0x810541, + plum_pie = 0x7D0541, + plum_velvet = 0x7D0552, + dark_raspberry = 0x872657, + velvet_maroon = 0x7E354D, + rosy_finch = 0x7F4E52, + dull_purple = 0x7F525D, + puce = 0x7F5A58, + rose_dust = 0x997070, + pastel_brown = 0xB1907F, + rosy_pink = 0xB38481, + rosy_brown = 0xBC8F8F, + khaki_rose = 0xC5908E, + lipstick_pink = 0xC48793, + pink_brown = 0xC48189, + old_rose = 0xC08081, + dusty_pink = 0xD58A94, + pink_daisy = 0xE799A3, + rose = 0xE8ADAA, + dusty_rose = 0xC9A9A6, + silver_pink = 0xC4AEAD, + gold_pink = 0xE6C7C2, + rose_gold = 0xECC5C0, + deep_peach = 0xFFCBA4, + pastel_orange = 0xF8B88B, + desert_sand = 0xEDC9AF, + unbleached_silk = 0xFFDDCA, + pig_pink = 0xFDD7E4, + pale_pink = 0xF2D4D7, + blush = 0xFFE6E8, + misty_rose = 0xFFE4E1, + pink_bubble_gum = 0xFFDFDD, + light_rose = 0xFBCFCD, + light_red = 0xFFCCCB, + warm_pink = 0xF6C6BD, + deep_rose = 0xFBBBB9, + light_pink = 0xFFB6C1, + soft_pink = 0xFFB8BF, + donut_pink = 0xFAAFBE, + baby_pink = 0xFAAFBA, + flamingo_pink = 0xF9A7B0, + pastel_pink = 0xFEA3AA, + rose_pink = 0xE7A1B0, + pink_rose = 0xE7A1B0, + cadillac_pink = 0xE38AAE, + carnation_pink = 0xF778A1, + pastel_rose = 0xE5788F, + blush_red = 0xE56E94, + pale_violet_red = 0xDB7093, + purple_pink = 0xD16587, + tulip_pink = 0xC25A7C, + bashful_pink = 0xC25283, + dark_pink = 0xE75480, + dark_hot_pink = 0xF660AB, + hot_pink = 0xFF69B4, + watermelon_pink = 0xFC6C85, + violet_red = 0xF6358A, + hot_deep_pink = 0xF52887, + bright_pink = 0xFF007F, + deep_pink = 0xFF1493, + neon_pink = 0xF535AA, + chrome_pink = 0xFF33AA, + neon_hot_pink = 0xFD349C, + pink_cupcake = 0xE45E9D, + royal_pink = 0xE759AC, + dimorphotheca_magenta = 0xE3319D, + pink_lemonade = 0xE4287C, + red_pink = 0xFA2A55, + crimson = 0xDC143C, + bright_maroon = 0xC32148, + rose_red = 0xC21E56, + rogue_pink = 0xC12869, + burnt_pink = 0xC12267, + pink_violet = 0xCA226B, + magenta_pink = 0xCC338B, + medium_violet_red = 0xC71585, + dark_carnation_pink = 0xC12283, + raspberry_purple = 0xB3446C, + pink_plum = 0xB93B8F, + orchid = 0xDA70D6, + deep_mauve = 0xDF73D4, + violet = 0xEE82EE, + fuchsia_pink = 0xFF77FF, + bright_neon_pink = 0xF433FF, + fuchsia = 0xFF00FF, + crimson_purple = 0xE238EC, + heliotrope_purple = 0xD462FF, + tyrian_purple = 0xC45AEC, + medium_orchid = 0xBA55D3, + purple_flower = 0xA74AC7, + orchid_purple = 0xB048B5, + rich_lilac = 0xB666D2, + pastel_violet = 0xD291BC, + mauve_taupe = 0x915F6D, + viola_purple = 0x7E587E, + eggplant = 0x614051, + plum_purple = 0x583759, + grape = 0x5E5A80, + purple_navy = 0x4E5180, + slate_blue = 0x6A5ACD, + blue_lotus = 0x6960EC, + blurple = 0x5865F2, + light_slate_blue = 0x736AFF, + medium_slate_blue = 0x7B68EE, + periwinkle_purple = 0x7575CF, + very_peri = 0x6667AB, + bright_grape = 0x6F2DA8, + purple_amethyst = 0x6C2DC7, + bright_purple = 0x6A0DAD, + deep_periwinkle = 0x5453A6, + dark_slate_blue = 0x483D8B, + purple_haze = 0x4E387E, + purple_iris = 0x571B7E, + dark_purple = 0x4B0150, + deep_purple = 0x36013F, + midnight_purple = 0x2E1A47, + purple_monster = 0x461B7E, + indigo = 0x4B0082, + blue_whale = 0x342D7E, + rebecca_purple = 0x663399, + purple_jam = 0x6A287E, + dark_magenta = 0x8B008B, + purple = 0x800080, + french_lilac = 0x86608E, + dark_orchid = 0x9932CC, + dark_violet = 0x9400D3, + purple_violet = 0x8D38C9, + jasmine_purple = 0xA23BEC, + purple_daffodil = 0xB041FF, + clematis_violet = 0x842DCE, + blue_violet = 0x8A2BE2, + purple_sage_bush = 0x7A5DC7, + lovely_purple = 0x7F38EC, + neon_purple = 0x9D00FF, + purple_plum = 0x8E35EF, + aztech_purple = 0x893BFF, + medium_purple = 0x9370DB, + light_purple = 0x8467D7, + crocus_purple = 0x9172EC, + purple_mimosa = 0x9E7BFF, + periwinkle = 0xCCCCFF, + pale_lilac = 0xDCD0FF, + lavender_purple = 0x967BB6, + rose_purple = 0xB09FCA, + lilac = 0xC8A2C8, + mauve = 0xE0B0FF, + bright_lilac = 0xD891EF, + purple_dragon = 0xC38EC7, + plum = 0xDDA0DD, + blush_pink = 0xE6A9EC, + pastel_purple = 0xF2A2E8, + blossom_pink = 0xF9B7FF, + wisteria_purple = 0xC6AEC7, + purple_thistle = 0xD2B9D3, + thistle = 0xD8BFD8, + purple_white = 0xDFD3E3, + periwinkle_pink = 0xE9CFEC, + cotton_candy = 0xFCDFFF, + lavender_pinocchio = 0xEBDDE2, + dark_white = 0xE1D9D1, + ash_white = 0xE9E4D4, + white_chocolate = 0xEDE6D6, + soft_ivory = 0xFAF0DD, + off_white = 0xF8F0E3, + pearl_white = 0xF8F6F0, + red_white = 0xF3E8EA, + lavender_blush = 0xFFF0F5, + pearl = 0xFDEEF4, + egg_shell = 0xFFF9E3, + old_lace = 0xFEF0E3, + linen = 0xFAF0E6, + sea_shell = 0xFFF5EE, + bone_white = 0xF9F6EE, + rice = 0xFAF5EF, + floral_white = 0xFFFAF0, + ivory = 0xFFFFF0, + white_gold = 0xFFFFF4, + light_white = 0xFFFFF7, + white_smoke = 0xF5F5F5, + cotton = 0xFBFBF9, + snow = 0xFFFAFA, + milk_white = 0xFEFCFF, + half_white = 0xFFFEFA; +} // namespace colors + +/** + * @brief Predefined colour constants, same as colors but for the british. + */ +namespace colours = colors; } // namespace dpp diff --git a/include/dpp/commandhandler.h b/include/dpp/commandhandler.h index 304ba9318e..724f38f577 100644 --- a/include/dpp/commandhandler.h +++ b/include/dpp/commandhandler.h @@ -50,6 +50,7 @@ struct DPP_EXPORT resolved_user { * @brief Holds user information */ dpp::user user; + /** * @brief Holds member information */ @@ -69,13 +70,40 @@ typedef std::variant> bulk_registration_list_guild; + /** * @brief List of global commands to bulk register */ @@ -384,7 +418,9 @@ class DPP_EXPORT commandhandler { */ void thinking(command_source source, command_completion_event_t callback = utility::log_error()); - /* Easter egg */ + /** + * @brief Easter egg (redefinition of dpp::commandhandler::thinking). + */ void thonk(command_source source, command_completion_event_t callback = utility::log_error()); }; diff --git a/include/dpp/discordevents.h b/include/dpp/discordevents.h index 0154d4a44b..c29d686bfc 100644 --- a/include/dpp/discordevents.h +++ b/include/dpp/discordevents.h @@ -29,21 +29,24 @@ namespace dpp { -/** @brief Returns a snowflake id from a json field value, if defined, else returns 0 +/** + * @brief Returns a snowflake id from a json field value, if defined, else returns 0 * @param j nlohmann::json instance to retrieve value from * @param keyname key name to check for a value * @return found value */ uint64_t DPP_EXPORT snowflake_not_null(const nlohmann::json* j, const char *keyname); -/** @brief Sets a snowflake id from a json field value, if defined, else does nothing +/** + * @brief Sets a snowflake id from a json field value, if defined, else does nothing * @param j nlohmann::json instance to retrieve value from * @param keyname key name to check for a value * @param v Value to change */ void DPP_EXPORT set_snowflake_not_null(const nlohmann::json* j, const char *keyname, uint64_t &v); -/** @brief Sets an array of snowflakes from a json field value, if defined, else does nothing +/** + * @brief Sets an array of snowflakes from a json field value, if defined, else does nothing * @param j nlohmann::json instance to retrieve value from * @param keyname key name to check for the values * @param v Value to change @@ -58,7 +61,8 @@ void DPP_EXPORT set_snowflake_array_not_null(const nlohmann::json* j, const char */ void DPP_EXPORT for_each_json(nlohmann::json* parent, std::string_view key, const std::function &fn); -/** @brief Sets an array of objects from a json field value, if defined, else does nothing +/** + * @brief Sets an array of objects from a json field value, if defined, else does nothing * @tparam T The class of which the array consists of. Must be derived from dpp::json_interface * @param j nlohmann::json instance to retrieve value from * @param keyname key name to check for the values @@ -71,42 +75,48 @@ template void set_object_array_not_null(nlohmann::json* j, std::string_ }); } -/** @brief Returns a string from a json field value, if defined, else returns an empty string. +/** + * @brief Returns a string from a json field value, if defined, else returns an empty string. * @param j nlohmann::json instance to retrieve value from * @param keyname key name to check for a value * @return found value */ std::string DPP_EXPORT string_not_null(const nlohmann::json* j, const char *keyname); -/** @brief Sets a string from a json field value, if defined, else does nothing +/** + * @brief Sets a string from a json field value, if defined, else does nothing * @param j nlohmann::json instance to retrieve value from * @param keyname key name to check for a value * @param v Value to change */ void DPP_EXPORT set_string_not_null(const nlohmann::json* j, const char *keyname, std::string &v); -/** @brief This is a repeat of set_string_not_null, but takes in a iconhash. +/** + * @brief This is a repeat of set_string_not_null, but takes in a iconhash. * @param j nlohmann::json instance to retrieve value from * @param keyname key name to check for a value * @param v Value to change */ void DPP_EXPORT set_iconhash_not_null(const nlohmann::json* j, const char *keyname, utility::iconhash &v); -/** @brief Returns a double from a json field value, if defined, else returns 0. +/** + * @brief Returns a double from a json field value, if defined, else returns 0. * @param j nlohmann::json instance to retrieve value from * @param keyname key name to check for a value * @return found value */ double DPP_EXPORT double_not_null(const nlohmann::json* j, const char *keyname); -/** @brief Sets a double from a json field value, if defined, else does nothing +/** + * @brief Sets a double from a json field value, if defined, else does nothing * @param j nlohmann::json instance to retrieve value from * @param keyname key name to check for a value * @param v Value to change */ void DPP_EXPORT set_double_not_null(const nlohmann::json* j, const char *keyname, double &v); -/** @brief Returns a 64 bit unsigned integer from a json field value, if defined, else returns 0. +/** + * @brief Returns a 64 bit unsigned integer from a json field value, if defined, else returns 0. * DO NOT use this for snowflakes, as usually snowflakes are wrapped in a string! * @param j nlohmann::json instance to retrieve value from * @param keyname key name to check for a value @@ -114,70 +124,80 @@ void DPP_EXPORT set_double_not_null(const nlohmann::json* j, const char *keyname */ uint64_t DPP_EXPORT int64_not_null(const nlohmann::json* j, const char *keyname); -/** @brief Sets an unsigned 64 bit integer from a json field value, if defined, else does nothing +/** + * @brief Sets an unsigned 64 bit integer from a json field value, if defined, else does nothing * @param j nlohmann::json instance to retrieve value from * @param keyname key name to check for a value * @param v Value to change */ void DPP_EXPORT set_int64_not_null(const nlohmann::json* j, const char *keyname, uint64_t &v); -/** @brief Returns a 32 bit unsigned integer from a json field value, if defined, else returns 0 +/** + * @brief Returns a 32 bit unsigned integer from a json field value, if defined, else returns 0 * @param j nlohmann::json instance to retrieve value from * @param keyname key name to check for a value * @return found value */ uint32_t DPP_EXPORT int32_not_null(const nlohmann::json* j, const char *keyname); -/** @brief Sets an unsigned 32 bit integer from a json field value, if defined, else does nothing +/** + * @brief Sets an unsigned 32 bit integer from a json field value, if defined, else does nothing * @param j nlohmann::json instance to retrieve value from * @param keyname key name to check for a value * @param v Value to change */ void DPP_EXPORT set_int32_not_null(const nlohmann::json* j, const char *keyname, uint32_t &v); -/** @brief Returns a 16 bit unsigned integer from a json field value, if defined, else returns 0 +/** + * @brief Returns a 16 bit unsigned integer from a json field value, if defined, else returns 0 * @param j nlohmann::json instance to retrieve value from * @param keyname key name to check for a value * @return found value */ uint16_t DPP_EXPORT int16_not_null(const nlohmann::json* j, const char *keyname); -/** @brief Sets an unsigned 16 bit integer from a json field value, if defined, else does nothing +/** + * @brief Sets an unsigned 16 bit integer from a json field value, if defined, else does nothing * @param j nlohmann::json instance to retrieve value from * @param keyname key name to check for a value * @param v Value to change */ void DPP_EXPORT set_int16_not_null(const nlohmann::json* j, const char *keyname, uint16_t &v); -/** @brief Returns an 8 bit unsigned integer from a json field value, if defined, else returns 0 +/** + * @brief Returns an 8 bit unsigned integer from a json field value, if defined, else returns 0 * @param j nlohmann::json instance to retrieve value from * @param keyname key name to check for a value * @return found value */ uint8_t DPP_EXPORT int8_not_null(const nlohmann::json* j, const char *keyname); -/** @brief Sets an unsigned 8 bit integer from a json field value, if defined, else does nothing +/** + * @brief Sets an unsigned 8 bit integer from a json field value, if defined, else does nothing * @param j nlohmann::json instance to retrieve value from * @param keyname key name to check for a value * @param v Value to change */ void DPP_EXPORT set_int8_not_null(const nlohmann::json* j, const char *keyname, uint8_t &v); -/** @brief Returns a boolean value from a json field value, if defined, else returns false +/** + * @brief Returns a boolean value from a json field value, if defined, else returns false * @param j nlohmann::json instance to retrieve value from * @param keyname key name to check for a value * @return found value */ bool DPP_EXPORT bool_not_null(const nlohmann::json* j, const char *keyname); -/** @brief Sets a boolean from a json field value, if defined, else does nothing +/** + * @brief Sets a boolean from a json field value, if defined, else does nothing * @param j nlohmann::json instance to retrieve value from * @param keyname key name to check for a value * @param v Value to change */ void DPP_EXPORT set_bool_not_null(const nlohmann::json* j, const char *keyname, bool &v); -/** @brief Returns a time_t from an ISO8601 timestamp field in a json value, if defined, else returns +/** + * @brief Returns a time_t from an ISO8601 timestamp field in a json value, if defined, else returns * epoch value of 0. * @param j nlohmann::json instance to retrieve value from * @param keyname key name to check for a value @@ -185,14 +205,16 @@ void DPP_EXPORT set_bool_not_null(const nlohmann::json* j, const char *keyname, */ time_t DPP_EXPORT ts_not_null(const nlohmann::json* j, const char *keyname); -/** @brief Sets an timestamp from a json field value containing an ISO8601 string, if defined, else does nothing +/** + * @brief Sets an timestamp from a json field value containing an ISO8601 string, if defined, else does nothing * @param j nlohmann::json instance to retrieve value from * @param keyname key name to check for a value * @param v Value to change */ void DPP_EXPORT set_ts_not_null(const nlohmann::json* j, const char *keyname, time_t &v); -/** @brief Base64 encode data into a string. +/** + * @brief Base64 encode data into a string. * @param buf Raw binary buffer * @param buffer_length Buffer length to encode * @return The base64 encoded string diff --git a/include/dpp/discordvoiceclient.h b/include/dpp/discordvoiceclient.h index cc88ec04b8..4a13ab6725 100644 --- a/include/dpp/discordvoiceclient.h +++ b/include/dpp/discordvoiceclient.h @@ -93,6 +93,7 @@ struct DPP_EXPORT voice_out_packet { * Generally these will be RTP. */ std::string packet; + /** * @brief Duration of packet */ @@ -189,6 +190,7 @@ class DPP_EXPORT discord_voice_client : public websocket_client * voice payload. */ rtp_seq_t seq; + /** * @brief The timestamp of the RTP packet that generated this voice * payload. @@ -197,6 +199,7 @@ class DPP_EXPORT discord_voice_client : public websocket_client * number wraps around. */ rtp_timestamp_t timestamp; + /** * @brief The event payload that voice handlers receive. */ @@ -226,6 +229,7 @@ class DPP_EXPORT discord_voice_client : public websocket_client rtp_seq_t min_seq, max_seq; rtp_timestamp_t min_timestamp, max_timestamp; } range; + /** * @brief The queue of parked voice payloads. * @@ -234,10 +238,12 @@ class DPP_EXPORT discord_voice_client : public websocket_client * are parked and sorted in this queue. */ std::priority_queue parked_payloads; + /** * @brief The decoder ctls to be set on the decoder. */ std::vector> pending_decoder_ctls; + /** * @brief libopus decoder * @@ -251,6 +257,7 @@ class DPP_EXPORT discord_voice_client : public websocket_client * @brief Thread used to deliver incoming voice data to handlers. */ std::thread voice_courier; + /** * @brief Shared state between this voice client and the courier thread. */ @@ -259,16 +266,19 @@ class DPP_EXPORT discord_voice_client : public websocket_client * @brief Protects all following members. */ std::mutex mtx; + /** * @brief Signaled when there is a new payload to deliver or terminating state has changed. */ std::condition_variable signal_iteration; + /** * @brief Voice buffers to be reported to handler, grouped by speaker. * * Buffers are parked here and flushed every 500ms. */ std::map parked_voice_payloads; + /** * @brief Used to signal termination. * @@ -276,6 +286,7 @@ class DPP_EXPORT discord_voice_client : public websocket_client */ bool terminating = false; } voice_courier_shared_state; + /** * @brief The run loop of the voice courier thread. */ diff --git a/include/dpp/dispatcher.h b/include/dpp/dispatcher.h index 0df6996f42..4c41ab69ae 100644 --- a/include/dpp/dispatcher.h +++ b/include/dpp/dispatcher.h @@ -176,15 +176,21 @@ struct DPP_EXPORT event_dispatch_t { bool is_cancelled() const; }; -/** @brief Log messages */ +/** + * @brief Log messages + */ struct DPP_EXPORT log_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; - /** Severity */ + /** + * @brief Severity. + */ loglevel severity = ll_info; - /** Log Message */ + /** + * @brief Log Message + */ std::string message = {}; }; @@ -209,7 +215,9 @@ namespace utility { command_completion_event_t DPP_EXPORT log_error(); } // namespace utility -/** @brief Add user to scheduled event */ +/** + * @brief Add user to scheduled event + */ struct DPP_EXPORT guild_scheduled_event_user_add_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; @@ -230,7 +238,9 @@ struct DPP_EXPORT guild_scheduled_event_user_add_t : public event_dispatch_t { snowflake guild_id = {}; }; -/** @brief Delete user from scheduled event */ +/** + * @brief Delete user from scheduled event + */ struct DPP_EXPORT guild_scheduled_event_user_remove_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; @@ -251,7 +261,9 @@ struct DPP_EXPORT guild_scheduled_event_user_remove_t : public event_dispatch_t snowflake guild_id = {}; }; -/** @brief Create scheduled event */ +/** + * @brief Create scheduled event + */ struct DPP_EXPORT guild_scheduled_event_create_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; @@ -262,7 +274,9 @@ struct DPP_EXPORT guild_scheduled_event_create_t : public event_dispatch_t { scheduled_event created = {}; }; -/** @brief Create scheduled event */ +/** + * @brief Create scheduled event + */ struct DPP_EXPORT guild_scheduled_event_update_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; @@ -273,7 +287,9 @@ struct DPP_EXPORT guild_scheduled_event_update_t : public event_dispatch_t { scheduled_event updated = {}; }; -/** @brief Delete scheduled event */ +/** + * @brief Delete scheduled event + */ struct DPP_EXPORT guild_scheduled_event_delete_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; @@ -284,7 +300,9 @@ struct DPP_EXPORT guild_scheduled_event_delete_t : public event_dispatch_t { scheduled_event deleted = {}; }; -/** @brief Create automod rule */ +/** + * @brief Create automod rule + */ struct DPP_EXPORT automod_rule_create_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; @@ -295,7 +313,9 @@ struct DPP_EXPORT automod_rule_create_t : public event_dispatch_t { automod_rule created = {}; }; -/** @brief Update automod rule */ +/** + * @brief Update automod rule + */ struct DPP_EXPORT automod_rule_update_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; @@ -306,7 +326,9 @@ struct DPP_EXPORT automod_rule_update_t : public event_dispatch_t { automod_rule updated = {}; }; -/** @brief Delete automod rule */ +/** + * @brief Delete automod rule + */ struct DPP_EXPORT automod_rule_delete_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; @@ -317,7 +339,9 @@ struct DPP_EXPORT automod_rule_delete_t : public event_dispatch_t { automod_rule deleted = {}; }; -/** @brief Execute/trigger automod rule */ +/** + * @brief Execute/trigger automod rule + */ struct DPP_EXPORT automod_rule_execute_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; @@ -378,7 +402,9 @@ struct DPP_EXPORT automod_rule_execute_t : public event_dispatch_t { std::string matched_content = {}; }; -/** @brief Create stage instance */ +/** + * @brief Create stage instance + */ struct DPP_EXPORT stage_instance_create_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; @@ -389,7 +415,9 @@ struct DPP_EXPORT stage_instance_create_t : public event_dispatch_t { stage_instance created = {}; }; -/** @brief Update stage instance */ +/** + * @brief Update stage instance + */ struct DPP_EXPORT stage_instance_update_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; @@ -400,7 +428,9 @@ struct DPP_EXPORT stage_instance_update_t : public event_dispatch_t { stage_instance updated = {}; }; -/** @brief Delete stage instance */ +/** + * @brief Delete stage instance + */ struct DPP_EXPORT stage_instance_delete_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; @@ -411,12 +441,16 @@ struct DPP_EXPORT stage_instance_delete_t : public event_dispatch_t { stage_instance deleted = {}; }; -/** @brief Voice state update */ +/** + * @brief Voice state update + */ struct DPP_EXPORT voice_state_update_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; - /** Voice state */ + /** + * @brief Voice state + */ voicestate state = {}; }; @@ -427,7 +461,6 @@ struct DPP_EXPORT interaction_create_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; - /** * @brief Acknowledge interaction without displaying a message to the user, * for use with button and select menu components. @@ -684,6 +717,9 @@ struct DPP_EXPORT button_click_t : public interaction_create_t { uint8_t component_type = {}; }; +/** + * @brief On form submitted. + */ struct DPP_EXPORT form_submit_t : public interaction_create_t { private: using interaction_create_t::get_parameter; @@ -826,7 +862,9 @@ struct DPP_EXPORT select_click_t : public interaction_create_t { }; -/** @brief Delete guild */ +/** + * @brief Delete guild + */ struct DPP_EXPORT guild_delete_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; @@ -844,12 +882,16 @@ struct DPP_EXPORT guild_delete_t : public event_dispatch_t { snowflake guild_id{0}; }; -/** @brief Update guild stickers */ +/** + * @brief Update guild stickers + */ struct DPP_EXPORT guild_stickers_update_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; - /** Updating guild */ + /** + * @brief Updating guild + */ guild* updating_guild = nullptr; /** @@ -858,12 +900,16 @@ struct DPP_EXPORT guild_stickers_update_t : public event_dispatch_t { std::vector stickers = {}; }; -/** @brief Guild join request delete (user declined membership screening) */ +/** + * @brief Guild join request delete (user declined membership screening) + */ struct DPP_EXPORT guild_join_request_delete_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; - /** Deleted guild */ + /** + * @brief Deleted guild + */ snowflake guild_id = {}; /** @@ -872,7 +918,9 @@ struct DPP_EXPORT guild_join_request_delete_t : public event_dispatch_t { snowflake user_id = {}; }; -/** @brief Delete channel */ +/** + * @brief Delete channel + */ struct DPP_EXPORT channel_delete_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; @@ -888,7 +936,9 @@ struct DPP_EXPORT channel_delete_t : public event_dispatch_t { channel deleted; }; -/** @brief Update channel */ +/** + * @brief Update channel + */ struct DPP_EXPORT channel_update_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; @@ -904,7 +954,9 @@ struct DPP_EXPORT channel_update_t : public event_dispatch_t { channel* updated = nullptr; }; -/** @brief Session ready */ +/** + * @brief Session ready + */ struct DPP_EXPORT ready_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; @@ -920,7 +972,9 @@ struct DPP_EXPORT ready_t : public event_dispatch_t { uint32_t shard_id = {}; }; -/** @brief Message Deleted */ +/** + * @brief Message Deleted + */ struct DPP_EXPORT message_delete_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; @@ -943,7 +997,9 @@ struct DPP_EXPORT message_delete_t : public event_dispatch_t { }; -/** @brief Guild member remove */ +/** + * @brief Guild member remove + */ struct DPP_EXPORT guild_member_remove_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; @@ -964,7 +1020,9 @@ struct DPP_EXPORT guild_member_remove_t : public event_dispatch_t { user removed; }; -/** @brief Session resumed */ +/** + * @brief Session resumed + */ struct DPP_EXPORT resumed_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; @@ -980,7 +1038,9 @@ struct DPP_EXPORT resumed_t : public event_dispatch_t { uint32_t shard_id = 0; }; -/** @brief Guild role create */ +/** + * @brief Guild role create + */ struct DPP_EXPORT guild_role_create_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; @@ -996,7 +1056,9 @@ struct DPP_EXPORT guild_role_create_t : public event_dispatch_t { role* created = nullptr; }; -/** @brief Typing start */ +/** + * @brief Typing start + */ struct DPP_EXPORT typing_start_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; @@ -1029,20 +1091,28 @@ struct DPP_EXPORT typing_start_t : public event_dispatch_t { time_t timestamp = 0; }; -/** @brief Voice state update */ +/** + * @brief Voice state update + */ struct DPP_EXPORT voice_track_marker_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; - /** Voice client */ + /** + * @brief Voice client + */ discord_voice_client* voice_client = nullptr; - /** Track metadata */ + /** + * @brief Track metadata + */ std::string track_meta = {}; }; -/** @brief Message reaction add */ +/** + * @brief Message reaction add + */ struct DPP_EXPORT message_reaction_add_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; @@ -1089,7 +1159,9 @@ struct DPP_EXPORT message_reaction_add_t : public event_dispatch_t { snowflake message_author_id = {}; }; -/** @brief Guild members chunk */ +/** + * @brief Guild members chunk + */ struct DPP_EXPORT guild_members_chunk_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; @@ -1105,7 +1177,9 @@ struct DPP_EXPORT guild_members_chunk_t : public event_dispatch_t { guild_member_map* members = nullptr; }; -/** @brief Message reaction remove */ +/** + * @brief Message reaction remove + */ struct DPP_EXPORT message_reaction_remove_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; @@ -1142,7 +1216,9 @@ struct DPP_EXPORT message_reaction_remove_t : public event_dispatch_t { snowflake message_id = {}; }; -/** @brief Create guild */ +/** + * @brief Create guild + */ struct DPP_EXPORT guild_create_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; @@ -1181,7 +1257,9 @@ struct DPP_EXPORT guild_create_t : public event_dispatch_t { sticker_map stickers = {}; }; -/** @brief Create channel */ +/** + * @brief Create channel + */ struct DPP_EXPORT channel_create_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; @@ -1197,7 +1275,9 @@ struct DPP_EXPORT channel_create_t : public event_dispatch_t { channel* created = nullptr; }; -/** @brief Message remove emoji */ +/** + * @brief Message remove emoji + */ struct DPP_EXPORT message_reaction_remove_emoji_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; @@ -1229,7 +1309,9 @@ struct DPP_EXPORT message_reaction_remove_emoji_t : public event_dispatch_t { snowflake message_id = {}; }; -/** @brief Message delete bulk */ +/** + * @brief Message delete bulk + */ struct DPP_EXPORT message_delete_bulk_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; @@ -1255,7 +1337,9 @@ struct DPP_EXPORT message_delete_bulk_t : public event_dispatch_t { std::vector deleted = {}; }; -/** @brief Guild role update */ +/** + * @brief Guild role update + */ struct DPP_EXPORT guild_role_update_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; @@ -1271,7 +1355,9 @@ struct DPP_EXPORT guild_role_update_t : public event_dispatch_t { role* updated = nullptr; }; -/** @brief Guild role delete */ +/** + * @brief Guild role delete + */ struct DPP_EXPORT guild_role_delete_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; @@ -1292,7 +1378,9 @@ struct DPP_EXPORT guild_role_delete_t : public event_dispatch_t { snowflake role_id = {}; }; -/** @brief Channel pins update */ +/** + * @brief Channel pins update + */ struct DPP_EXPORT channel_pins_update_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; @@ -1313,7 +1401,9 @@ struct DPP_EXPORT channel_pins_update_t : public event_dispatch_t { time_t timestamp = 0; }; -/** @brief Message remove all reactions */ +/** + * @brief Message remove all reactions + */ struct DPP_EXPORT message_reaction_remove_all_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; @@ -1341,7 +1431,9 @@ struct DPP_EXPORT message_reaction_remove_all_t : public event_dispatch_t { }; -/** @brief Voice server update */ +/** + * @brief Voice server update + */ struct DPP_EXPORT voice_server_update_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; @@ -1362,7 +1454,9 @@ struct DPP_EXPORT voice_server_update_t : public event_dispatch_t { std::string endpoint = {}; }; -/** @brief Guild emojis update */ +/** + * @brief Guild emojis update + */ struct DPP_EXPORT guild_emojis_update_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; @@ -1392,7 +1486,9 @@ struct DPP_EXPORT presence_update_t : public event_dispatch_t { presence rich_presence = {}; }; -/** @brief Webhooks update */ +/** + * @brief Webhooks update + */ struct DPP_EXPORT webhooks_update_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; @@ -1408,7 +1504,9 @@ struct DPP_EXPORT webhooks_update_t : public event_dispatch_t { channel* webhook_channel = nullptr; }; -/** @brief Guild member add */ +/** + * @brief Guild member add + */ struct DPP_EXPORT guild_member_add_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; @@ -1424,7 +1522,9 @@ struct DPP_EXPORT guild_member_add_t : public event_dispatch_t { guild_member added = {}; }; -/** @brief Invite delete */ +/** + * @brief Invite delete + */ struct DPP_EXPORT invite_delete_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; @@ -1435,7 +1535,9 @@ struct DPP_EXPORT invite_delete_t : public event_dispatch_t { invite deleted_invite = {}; }; -/** @brief Guild update */ +/** + * @brief Guild update + */ struct DPP_EXPORT guild_update_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; @@ -1446,7 +1548,9 @@ struct DPP_EXPORT guild_update_t : public event_dispatch_t { guild* updated = nullptr; }; -/** @brief Guild integrations update */ +/** + * @brief Guild integrations update + */ struct DPP_EXPORT guild_integrations_update_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; @@ -1457,7 +1561,9 @@ struct DPP_EXPORT guild_integrations_update_t : public event_dispatch_t { guild* updating_guild = nullptr; }; -/** @brief Guild member update */ +/** + * @brief Guild member update + */ struct DPP_EXPORT guild_member_update_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; @@ -1473,7 +1579,9 @@ struct DPP_EXPORT guild_member_update_t : public event_dispatch_t { guild_member updated = {}; }; -/** @brief Invite create */ +/** + * @brief Invite create + */ struct DPP_EXPORT invite_create_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; @@ -1484,7 +1592,9 @@ struct DPP_EXPORT invite_create_t : public event_dispatch_t { invite created_invite = {}; }; -/** @brief Message update */ +/** + * @brief Message update + */ struct DPP_EXPORT message_update_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; @@ -1495,7 +1605,9 @@ struct DPP_EXPORT message_update_t : public event_dispatch_t { message msg = {}; }; -/** @brief User update */ +/** + * @brief User update + */ struct DPP_EXPORT user_update_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; @@ -1506,7 +1618,9 @@ struct DPP_EXPORT user_update_t : public event_dispatch_t { user updated = {}; }; -/** @brief Create message */ +/** + * @brief Create message + */ struct DPP_EXPORT message_create_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; @@ -1562,7 +1676,9 @@ struct DPP_EXPORT message_create_t : public event_dispatch_t { void reply(message&& msg, bool mention_replied_user = false, command_completion_event_t callback = utility::log_error()) const; }; -/** @brief Guild audit log entry create */ +/** + * @brief Guild audit log entry create + */ struct DPP_EXPORT guild_audit_log_entry_create_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; @@ -1573,7 +1689,9 @@ struct DPP_EXPORT guild_audit_log_entry_create_t : public event_dispatch_t { audit_entry entry = {}; }; -/** @brief Guild ban add */ +/** + * @brief Guild ban add + */ struct DPP_EXPORT guild_ban_add_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; @@ -1589,7 +1707,9 @@ struct DPP_EXPORT guild_ban_add_t : public event_dispatch_t { user banned = {}; }; -/** @brief Guild ban remove */ +/** + * @brief Guild ban remove + */ struct DPP_EXPORT guild_ban_remove_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; @@ -1605,7 +1725,9 @@ struct DPP_EXPORT guild_ban_remove_t : public event_dispatch_t { user unbanned = {}; }; -/** @brief Integration create */ +/** + * @brief Integration create + */ struct DPP_EXPORT integration_create_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; @@ -1616,7 +1738,9 @@ struct DPP_EXPORT integration_create_t : public event_dispatch_t { integration created_integration = {}; }; -/** @brief Integration update */ +/** + * @brief Integration update + */ struct DPP_EXPORT integration_update_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; @@ -1627,7 +1751,9 @@ struct DPP_EXPORT integration_update_t : public event_dispatch_t { integration updated_integration = {}; }; -/** @brief Integration delete */ +/** + * @brief Integration delete + */ struct DPP_EXPORT integration_delete_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; @@ -1638,7 +1764,9 @@ struct DPP_EXPORT integration_delete_t : public event_dispatch_t { integration deleted_integration = {}; }; -/** @brief Thread Create*/ +/** + * @brief Thread Create + */ struct DPP_EXPORT thread_create_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; @@ -1654,8 +1782,9 @@ struct DPP_EXPORT thread_create_t : public event_dispatch_t { thread created = {}; }; -/** @brief Thread Update -*/ +/** + * @brief Thread Update + */ struct DPP_EXPORT thread_update_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; @@ -1671,7 +1800,8 @@ struct DPP_EXPORT thread_update_t : public event_dispatch_t { thread updated = {}; }; -/** @brief Thread Delete +/** + * @brief Thread Delete */ struct DPP_EXPORT thread_delete_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; @@ -1688,7 +1818,8 @@ struct DPP_EXPORT thread_delete_t : public event_dispatch_t { thread deleted = {}; }; -/** @brief Thread List Sync +/** + * @brief Thread List Sync */ struct DPP_EXPORT thread_list_sync_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; @@ -1710,7 +1841,8 @@ struct DPP_EXPORT thread_list_sync_t : public event_dispatch_t { std::vector members = {}; }; -/** @brief Thread Member Update +/** + * @brief Thread Member Update */ struct DPP_EXPORT thread_member_update_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; @@ -1722,7 +1854,8 @@ struct DPP_EXPORT thread_member_update_t : public event_dispatch_t { thread_member updated = {}; }; -/** @brief Thread Members Update +/** + * @brief Thread Members Update */ struct DPP_EXPORT thread_members_update_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; @@ -1773,7 +1906,9 @@ struct DPP_EXPORT voice_buffer_send_t : public event_dispatch_t { int buffer_size = 0; }; -/** @brief voice user talking */ +/** + * @brief voice user talking + */ struct DPP_EXPORT voice_user_talking_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; @@ -1794,7 +1929,9 @@ struct DPP_EXPORT voice_user_talking_t : public event_dispatch_t { uint8_t talking_flags = 0; }; -/** @brief voice user talking */ +/** + * @brief voice user talking + */ struct DPP_EXPORT voice_ready_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; @@ -1810,7 +1947,9 @@ struct DPP_EXPORT voice_ready_t : public event_dispatch_t { snowflake voice_channel_id = {}; }; -/** @brief voice receive packet */ +/** + * @brief voice receive packet + */ struct DPP_EXPORT voice_receive_t : public event_dispatch_t { friend class discord_voice_client; @@ -1882,7 +2021,9 @@ struct DPP_EXPORT voice_receive_t : public event_dispatch_t { void reassign(discord_voice_client* vc, snowflake _user_id, const uint8_t* pcm, size_t length); }; -/** @brief voice client speaking event */ +/** + * @brief voice client speaking event + */ struct DPP_EXPORT voice_client_speaking_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; @@ -1903,7 +2044,9 @@ struct DPP_EXPORT voice_client_speaking_t : public event_dispatch_t { uint32_t ssrc = 0; }; -/** @brief voice client disconnect event */ +/** + * @brief voice client disconnect event + */ struct DPP_EXPORT voice_client_disconnect_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; @@ -1919,7 +2062,9 @@ struct DPP_EXPORT voice_client_disconnect_t : public event_dispatch_t { snowflake user_id = {}; }; -/** @brief Delete stage instance */ +/** + * @brief Delete stage instance + */ struct DPP_EXPORT entitlement_create_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; @@ -1930,7 +2075,9 @@ struct DPP_EXPORT entitlement_create_t : public event_dispatch_t { entitlement created = {}; }; -/** @brief Delete stage instance */ +/** + * @brief Delete stage instance + */ struct DPP_EXPORT entitlement_update_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; @@ -1941,7 +2088,9 @@ struct DPP_EXPORT entitlement_update_t : public event_dispatch_t { entitlement updating_entitlement = {}; }; -/** @brief Delete stage instance */ +/** + * @brief Delete stage instance + */ struct DPP_EXPORT entitlement_delete_t : public event_dispatch_t { using event_dispatch_t::event_dispatch_t; using event_dispatch_t::operator=; diff --git a/include/dpp/dtemplate.h b/include/dpp/dtemplate.h index 3c1bbb724a..098824e458 100644 --- a/include/dpp/dtemplate.h +++ b/include/dpp/dtemplate.h @@ -54,35 +54,43 @@ class DPP_EXPORT dtemplate : public json_interface { * @brief Template code */ std::string code; + /** * @brief Template name */ std::string name; + /** * @brief Template description */ std::string description; + /** * @brief Usage counter */ uint32_t usage_count; + /** * @brief User ID of creator */ snowflake creator_id; + /** * @brief Creation date/time * */ time_t created_at; + /** * @brief Last update date/time */ time_t updated_at; + /** * @brief Guild id the template is created from */ snowflake source_guild_id; + /** * @brief True if needs synchronising */ @@ -99,8 +107,9 @@ class DPP_EXPORT dtemplate : public json_interface { virtual ~dtemplate() = default; }; -/** A container of invites */ +/** + * @brief A container of invites + */ typedef std::unordered_map dtemplate_map; - } // namespace dpp diff --git a/include/dpp/emoji.h b/include/dpp/emoji.h index fff307d0f4..40b38b1571 100644 --- a/include/dpp/emoji.h +++ b/include/dpp/emoji.h @@ -37,13 +37,24 @@ namespace dpp { * @brief Flags for dpp::emoji */ enum emoji_flags : uint8_t { - /// Emoji requires colons + /** + * @brief Emoji requires colons. + */ e_require_colons = 0b00000001, - /// Managed (introduced by application) + + /** + * @brief Managed (introduced by application) + */ e_managed = 0b00000010, - /// Animated + + /** + * @brief Animated emoji. + */ e_animated = 0b00000100, - /// Available (false if the guild doesn't meet boosting criteria, etc) + + /** + * @brief Available (false if the guild doesn't meet boosting criteria, etc) + */ e_available = 0b00001000, }; diff --git a/include/dpp/entitlement.h b/include/dpp/entitlement.h index e1cfab8818..dd7d1ae0d5 100644 --- a/include/dpp/entitlement.h +++ b/include/dpp/entitlement.h @@ -39,11 +39,13 @@ enum entitlement_type : uint8_t { * @warning This can only be used when creating a test entitlement. */ GUILD_SUBSCRIPTION = 1, + /** * @brief A subscription for a user. * @warning This can only be used when creating a test entitlement. */ USER_SUBSCRIPTION = 2, + /** * @brief Entitlement was purchased as an app subscription. */ diff --git a/include/dpp/etf.h b/include/dpp/etf.h index 28e3806a3d..8e17ca3a96 100644 --- a/include/dpp/etf.h +++ b/include/dpp/etf.h @@ -39,7 +39,9 @@ namespace dpp { -/** Current ETF format version in use */ +/** + * @brief Current ETF format version in use + */ const uint8_t FORMAT_VERSION = 131; /** @@ -47,60 +49,142 @@ const uint8_t FORMAT_VERSION = 131; * in the ETF binary structure. */ enum etf_token_type : uint8_t { - /// 68 [Distribution header] - ett_distribution = 'D', - /// 70 [Float64:IEEE float] - ett_new_float = 'F', - /// 77 [UInt32:Len, UInt8:Bits, Len:Data] - ett_bit_binary = 'M', - /// 80 [UInt4:UncompressedSize, N:ZlibCompressedData] - ett_compressed = 'P', - /// 97 [UInt8:Int] - ett_smallint = 'a', - /// 98 [Int32:Int] - ett_integer = 'b', - /// 99 [31:Float String] Float in string format (formatted "%.20e", sscanf "%lf"). Superseded by ett_new_float - ett_float = 'c', - /// 100 [UInt16:Len, Len:AtomName] max Len is 255 - ett_atom = 'd', - /// 101 [atom:Node, UInt32:ID, UInt8:Creation] - ett_reference = 'e', - /// 102 [atom:Node, UInt32:ID, UInt8:Creation] - ett_port = 'f', - /// 103 [atom:Node, UInt32:ID, UInt32:Serial, UInt8:Creation] - ett_pid = 'g', - /// 104 [UInt8:Arity, N:Elements] - ett_small_tuple = 'h', - /// 105 [UInt32:Arity, N:Elements] - ett_large_tuple = 'i', - /// 106 empty list - ett_nil = 'j', - /// 107 [UInt16:Len, Len:Characters] - ett_string = 'k', - /// 108 [UInt32:Len, Elements, Tail] - ett_list = 'l', - /// 109 [UInt32:Len, Len:Data] - ett_binary = 'm', - /// 110 [UInt8:n, UInt8:Sign, n:nums] - ett_bigint_small = 'n', - /// 111 [UInt32:n, UInt8:Sign, n:nums] - ett_bigint_large = 'o', - /// 112 [UInt32:Size, UInt8:Arity, 16*Uint6-MD5:Uniq, UInt32:Index, UInt32:NumFree, atom:Module, int:OldIndex, int:OldUniq, pid:Pid, NunFree*ext:FreeVars] - ett_new_function = 'p', - /// 113 [atom:Module, atom:Function, smallint:Arity] - ett_export = 'q', - /// 114 [UInt16:Len, atom:Node, UInt8:Creation, Len*UInt32:ID] - ett_new_reference = 'r', - /// 115 [UInt8:Len, Len:AtomName] - ett_atom_small = 's', - /// 116 [UInt32:Airty, N:Pairs] - ett_map = 't', - /// 117 [UInt4:NumFree, pid:Pid, atom:Module, int:Index, int:Uniq, NumFree*ext:FreeVars] - ett_function = 'u', - /// 118 [UInt16:Len, Len:AtomName] max Len is 255 characters (up to 4 bytes per) - ett_atom_utf8 = 'v', - /// 119 [UInt8:Len, Len:AtomName] - ett_atom_utf8_small = 'w' + /** + * @brief 68 [Distribution header] + */ + ett_distribution = 'D', + + /** + * @brief 70 [Float64:IEEE float] + */ + ett_new_float = 'F', + + /** + * @brief 77 [UInt32:Len, UInt8:Bits, Len:Data] + */ + ett_bit_binary = 'M', + + /** + * @brief 80 [UInt4:UncompressedSize, N:ZlibCompressedData] + */ + ett_compressed = 'P', + + /** + * @brief 97 [UInt8:Int] + */ + ett_smallint = 'a', + + /** + * @brief 98 [Int32:Int] + */ + ett_integer = 'b', + + /** + * @brief 99 [31:Float String] Float in string format (formatted "%.20e", sscanf "%lf"). + * + * @note Superseded by ett_new_float. + */ + ett_float = 'c', + + /** + * @brief 100 [UInt16:Len, Len:AtomName] max Len is 255 + */ + ett_atom = 'd', + + /** + * @brief 101 [atom:Node, UInt32:ID, UInt8:Creation] + */ + ett_reference = 'e', + + /** + * @brief 102 [atom:Node, UInt32:ID, UInt8:Creation] + */ + ett_port = 'f', + + /** + * @brief 103 [atom:Node, UInt32:ID, UInt32:Serial, UInt8:Creation] + */ + ett_pid = 'g', + + /** + * @brief 104 [UInt8:Arity, N:Elements] + */ + ett_small_tuple = 'h', + + /** + * @brief 105 [UInt32:Arity, N:Elements] + */ + ett_large_tuple = 'i', + + /** + * @brief 106 empty list + */ + ett_nil = 'j', + + /** + * @brief 107 [UInt16:Len, Len:Characters] + */ + ett_string = 'k', + + /** + * @brief 108 [UInt32:Len, Elements, Tail] + */ + ett_list = 'l', + + /** + * @brief 109 [UInt32:Len, Len:Data] + */ + ett_binary = 'm', + + /** + * @brief 110 [UInt8:n, UInt8:Sign, n:nums] + */ + ett_bigint_small = 'n', + + /** + * @brief 111 [UInt32:n, UInt8:Sign, n:nums] + */ + ett_bigint_large = 'o', + + /** + * @brief 112 [UInt32:Size, UInt8:Arity, 16*Uint6-MD5:Uniq, UInt32:Index, UInt32:NumFree, atom:Module, int:OldIndex, int:OldUniq, pid:Pid, NunFree*ext:FreeVars] + */ + ett_new_function = 'p', + + /** + * @brief 113 [atom:Module, atom:Function, smallint:Arity] + */ + ett_export = 'q', + + /** + * @brief 114 [UInt16:Len, atom:Node, UInt8:Creation, Len*UInt32:ID] + */ + ett_new_reference = 'r', + + /** + * @brief 115 [UInt8:Len, Len:AtomName] + */ + ett_atom_small = 's', + + /** + * @brief 116 [UInt32:Airty, N:Pairs] + */ + ett_map = 't', + + /** + * @brief 117 [UInt4:NumFree, pid:Pid, atom:Module, int:Index, int:Uniq, NumFree*ext:FreeVars] + */ + ett_function = 'u', + + /** + * @brief 118 [UInt16:Len, Len:AtomName] max Len is 255 characters (up to 4 bytes per) + */ + ett_atom_utf8 = 'v', + + /** + * @brief 119 [UInt8:Len, Len:AtomName] + */ + ett_atom_utf8_small = 'w' }; /** @@ -111,6 +195,7 @@ struct DPP_EXPORT etf_buffer { * @brief Raw buffer */ std::vector buf; + /** * @brief Current used length of buffer * (this is different from buf.size() as it is pre-allocated @@ -137,7 +222,6 @@ struct DPP_EXPORT etf_buffer { * have to be any different for handling ETF. */ class DPP_EXPORT etf_parser { - /** * @brief Current size of binary data */ diff --git a/include/dpp/event.h b/include/dpp/event.h index b9b3f003f7..fe6df9bb45 100644 --- a/include/dpp/event.h +++ b/include/dpp/event.h @@ -38,7 +38,8 @@ namespace dpp::events { */ class DPP_EXPORT event { public: - /** Pure virtual method for event handler code + /** + * @brief Pure virtual method for event handler code * @param client The creating shard * @param j The json data of the event * @param raw The raw event json diff --git a/include/dpp/event_router.h b/include/dpp/event_router.h index 027f25a0fc..5a16aaa74b 100644 --- a/include/dpp/event_router.h +++ b/include/dpp/event_router.h @@ -201,10 +201,15 @@ template class event_router_t { private: friend class cluster; - /** @brief Non-coro event handler type */ + /** + * @brief Non-coro event handler type + */ using regular_handler_t = std::function; - /** @brief Type that event handlers will be stored as with DPP_CORO off. This is the ABI DPP_CORO has to match */ + /** + * @brief Type that event handlers will be stored as with DPP_CORO off. + * This is the ABI DPP_CORO has to match. + */ using event_handler_abi_t = std::variant>; #ifdef DPP_CORO @@ -218,11 +223,15 @@ template class event_router_t { DPP_CHECK_ABI_COMPAT(event_handler_t, event_handler_abi_t) #else - /** @brief Type that event handlers are stored as */ + /** + * @brief Type that event handlers are stored as + */ using event_handler_t = event_handler_abi_t; #endif - /** @brief Identifier for the next event handler, will be given to the user on attaching a handler */ + /** + * @brief Identifier for the next event handler, will be given to the user on attaching a handler + */ event_handle next_handle = 1; /**