diff --git a/include/dpp/cluster.h b/include/dpp/cluster.h index 54e446a5ca..d7b7e27469 100644 --- a/include/dpp/cluster.h +++ b/include/dpp/cluster.h @@ -2804,7 +2804,7 @@ class DPP_EXPORT cluster { * @brief Get the guild's onboarding configuration * * @see https://discord.com/developers/docs/resources/guild#get-guild-onboarding - * @param o The onboarding object + * @param guild_id The guild to pull the onboarding configuration from. * @param callback Function to call when the API call completes. * On success the callback will contain a dpp::onboarding object in confirmation_callback_t::value filled to match the vanity url. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error(). */ diff --git a/include/dpp/cluster_coro_calls.h b/include/dpp/cluster_coro_calls.h index b0a2b1b46b..f5a41fa1ea 100644 --- a/include/dpp/cluster_coro_calls.h +++ b/include/dpp/cluster_coro_calls.h @@ -1063,7 +1063,7 @@ * * @see dpp::cluster::guild_get_onboarding * @see https://discord.com/developers/docs/resources/guild#get-guild-onboarding - * @param o The onboarding object + * @param guild_id The guild to pull the onboarding configuration from. * @return onboarding returned object on completion * \memberof dpp::cluster */ @@ -1528,6 +1528,15 @@ */ [[nodiscard]] async co_message_edit(const struct message &m); +/** + * @brief Edit the flags of a message on a channel. The callback function is called when the message has been edited + * + * @param m Message to edit the flags of + * @return message returned object on completion + * \memberof dpp::cluster + */ +[[nodiscard]] async co_message_edit_flags(const struct message &m); + /** * @brief Get a message * diff --git a/include/dpp/cluster_sync_calls.h b/include/dpp/cluster_sync_calls.h index 6764719a83..505c80029d 100644 --- a/include/dpp/cluster_sync_calls.h +++ b/include/dpp/cluster_sync_calls.h @@ -1303,7 +1303,7 @@ confirmation guild_sync_integration_sync(snowflake guild_id, snowflake integrati * * @see dpp::cluster::guild_get_onboarding * @see https://discord.com/developers/docs/resources/guild#get-guild-onboarding - * @param o The onboarding object + * @param guild_id The guild to pull the onboarding configuration from. * @return onboarding returned object on completion * \memberof dpp::cluster * @throw dpp::rest_exception upon failure to execute REST function @@ -1870,6 +1870,18 @@ confirmation message_delete_reaction_emoji_sync(snowflake message_id, snowflake */ message message_edit_sync(const struct message &m); +/** + * @brief Edit the flags of a message on a channel. The callback function is called when the message has been edited + * + * @param m Message to edit the flags of + * @return message returned object on completion + * \memberof dpp::cluster + * @throw dpp::rest_exception upon failure to execute REST function + * @warning This function is a blocking (synchronous) call and should only be used from within a separate thread. + * Avoid direct use of this function inside an event handler. + */ +message message_edit_flags_sync(const struct message &m); + /** * @brief Get a message * diff --git a/include/dpp/coro/coroutine.h b/include/dpp/coro/coroutine.h index a03d670b41..869882c2c8 100644 --- a/include/dpp/coro/coroutine.h +++ b/include/dpp/coro/coroutine.h @@ -58,7 +58,7 @@ using handle_t = std_coroutine::coroutine_handle>; /** * @brief Base class of dpp::coroutine. * - * @warn This class should not be used directly by a user, use dpp::coroutine instead. + * @warning This class should not be used directly by a user, use dpp::coroutine instead. * @note This class contains all the functions used internally by co_await. It is intentionally opaque and a private base of dpp::coroutine so a user cannot call await_suspend and await_resume directly. */ template diff --git a/include/dpp/discordevents.h b/include/dpp/discordevents.h index c29d686bfc..184294818b 100644 --- a/include/dpp/discordevents.h +++ b/include/dpp/discordevents.h @@ -55,7 +55,7 @@ void DPP_EXPORT set_snowflake_array_not_null(const nlohmann::json* j, const char /** * @brief Applies a function to each element of a json array. - * @param j nlohmann::json instance to retrieve value from + * @param parent nlohmann::json instance to retrieve value from * @param key key name to check for the values * @param fn function to apply to each element */ @@ -65,7 +65,7 @@ void DPP_EXPORT for_each_json(nlohmann::json* parent, std::string_view key, cons * @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 + * @param key key name to check for the values * @param v Value to change */ template void set_object_array_not_null(nlohmann::json* j, std::string_view key, std::vector& v) { diff --git a/include/dpp/discordvoiceclient.h b/include/dpp/discordvoiceclient.h index e71f221e1b..07e4364483 100644 --- a/include/dpp/discordvoiceclient.h +++ b/include/dpp/discordvoiceclient.h @@ -862,7 +862,7 @@ class DPP_EXPORT discord_voice_client : public websocket_client /** * @brief Change the iteration interval time. * - * @param time The time (in milliseconds) between each interval when parsing audio. + * @param interval The time (in milliseconds) between each interval when parsing audio. * * @return Reference to self. */ diff --git a/include/dpp/emoji.h b/include/dpp/emoji.h index 7e0549bd2a..6249b4c9eb 100644 --- a/include/dpp/emoji.h +++ b/include/dpp/emoji.h @@ -208,7 +208,8 @@ class DPP_EXPORT emoji : public managed, public json_interface { /** * @brief Load an image into the object * - * @param image_blob Image binary data + * @param data Image binary data + * @param size Size of the image. * @param type Type of image. It can be one of `i_gif`, `i_jpg` or `i_png`. * @return emoji& Reference to self * @throw dpp::length_exception Image content exceeds discord maximum of 256 kilobytes diff --git a/include/dpp/event_router.h b/include/dpp/event_router.h index 33793144f1..1657fbd592 100644 --- a/include/dpp/event_router.h +++ b/include/dpp/event_router.h @@ -690,7 +690,7 @@ template class event_router_t { * @brief Attach a callable to the event, adding a listener. * The callable should be of the form `void(const T&)` * where T is the event type for this event router. - * + *f * @warning You cannot call this within an event handler. * * @param fun Callable to attach to event diff --git a/include/dpp/guild.h b/include/dpp/guild.h index cbb394ce15..db631c33d1 100644 --- a/include/dpp/guild.h +++ b/include/dpp/guild.h @@ -1990,7 +1990,7 @@ struct DPP_EXPORT onboarding : public json_interface { /** * @brief Set guild_id of this onboarding object * - * @param guild_id Guild ID to set + * @param id Guild ID to set * @return Reference to self, so these method calls may be chained */ onboarding& set_guild_id(const snowflake id); diff --git a/include/dpp/httpsclient.h b/include/dpp/httpsclient.h index f043d533f7..7884baab39 100644 --- a/include/dpp/httpsclient.h +++ b/include/dpp/httpsclient.h @@ -249,7 +249,7 @@ class DPP_EXPORT https_client : public ssl_client { * @param extra_headers Additional request headers, e.g. user-agent, authorization, etc * @param plaintext_connection Set to true to make the connection plaintext (turns off SSL) * @param request_timeout How many seconds before the connection is considered failed if not finished - * @param http_protocol Request HTTP protocol + * @param protocol Request HTTP protocol (default: 1.1) */ https_client(const std::string &hostname, uint16_t port = 443, const std::string &urlpath = "/", const std::string &verb = "GET", const std::string &req_body = "", const http_headers& extra_headers = {}, bool plaintext_connection = false, uint16_t request_timeout = 5, const std::string &protocol = "1.1"); diff --git a/include/dpp/prune.h b/include/dpp/prune.h index 9952b841f2..36e6275f6d 100644 --- a/include/dpp/prune.h +++ b/include/dpp/prune.h @@ -71,7 +71,7 @@ struct DPP_EXPORT prune : public json_interface { /** * @brief Build JSON from this object. * - * @param with_prune_count True if the prune count boolean is to be set in the built JSON + * @param with_id True if the prune count boolean is to be set in the built JSON * @return The JSON of the prune object */ json to_json(bool with_id = false) const; // Intentional shadow of json_interface, mostly present for documentation diff --git a/include/dpp/role.h b/include/dpp/role.h index 44ca4a597e..a3da13f367 100644 --- a/include/dpp/role.h +++ b/include/dpp/role.h @@ -307,7 +307,8 @@ class DPP_EXPORT role : public managed, public json_interface { /** * @brief Load a role icon. * - * @param image_blob Image binary data + * @param data Image binary data + * @param size Size of the image. * @param type Type of image. It can be one of `i_gif`, `i_jpg` or `i_png`. * @return emoji& Reference to self */ diff --git a/include/dpp/scheduled_event.h b/include/dpp/scheduled_event.h index b0617719e1..52d5c559ac 100644 --- a/include/dpp/scheduled_event.h +++ b/include/dpp/scheduled_event.h @@ -317,7 +317,8 @@ struct DPP_EXPORT scheduled_event : public managed, public json_interface { /** * @brief Construct a new SKU object with all data required. * - * @param id SKU id. + * @param id ID of the SKU. + * @param type Type of SKU (sku_type). + * @param application_id ID of the parent application. + * @param name Customer-facing name of your premium offering. + * @param slug System-generated URL slug based on the SKU's name. + * @param flags Flags bitmap from dpp::sku_flags. + * */ sku(const snowflake id, const sku_type type, const snowflake application_id, const std::string name, const std::string slug, const uint16_t flags); diff --git a/include/dpp/sslclient.h b/include/dpp/sslclient.h index b1e674efc4..f43e3a575d 100644 --- a/include/dpp/sslclient.h +++ b/include/dpp/sslclient.h @@ -58,6 +58,7 @@ bool close_socket(dpp::socket sfd); * @brief Set a socket to blocking or non-blocking IO * * @param sockfd socket to act upon + * @param non_blocking should socket be non-blocking? * @return false on error, true on success */ bool set_nonblocking(dpp::socket sockfd, bool non_blocking); diff --git a/include/dpp/utility.h b/include/dpp/utility.h index 47b85f925d..f78d3b5b9e 100644 --- a/include/dpp/utility.h +++ b/include/dpp/utility.h @@ -365,13 +365,13 @@ struct DPP_EXPORT image_data { * * @param rhs Image to copy */ - image_data(image_data&&) noexcept = default; + image_data(image_data&& rhs) noexcept = default; /** * @brief Construct from string buffer * * @param format Image format - * @param str Data in a string + * @param bytes Data in a string * @see image_type */ image_data(image_type format, std::string_view bytes); @@ -380,8 +380,8 @@ struct DPP_EXPORT image_data { * @brief Construct from byte buffer * * @param format Image format - * @param buf Byte buffer - * @param size_t Image size in bytes + * @param bytes Data of the image + * @param byte_size Image size in bytes * @see image_type */ image_data(image_type format, const std::byte* bytes, uint32_t byte_size); @@ -405,8 +405,8 @@ struct DPP_EXPORT image_data { /** * @brief Set image data. * - * @param format Format of the image - * @param data Data of the image + * @param format Image format + * @param bytes Data of the image */ void set(image_type format, std::string_view bytes); @@ -414,7 +414,8 @@ struct DPP_EXPORT image_data { * @brief Set image data. * * @param format Format of the image - * @param data Data of the image + * @param bytes Data of the image + * @param byte_size Image size in bytes */ void set(image_type format, const std::byte* bytes, uint32_t byte_size); @@ -507,7 +508,7 @@ struct icon { /** * @brief Get as icon hash. * - * @warn The behavior is undefined if `is_iconhash() == false` + * @warning The behavior is undefined if `is_iconhash() == false` * @return iconhash& This iconhash */ iconhash& as_iconhash() &; @@ -515,7 +516,7 @@ struct icon { /** * @brief Get as icon hash. * - * @warn The behavior is undefined if `is_iconhash() == false` + * @warning The behavior is undefined if `is_iconhash() == false` * @return iconhash& This iconhash */ const iconhash& as_iconhash() const&; @@ -523,7 +524,7 @@ struct icon { /** * @brief Get as icon hash. * - * @warn The behavior is undefined if `is_iconhash() == false` + * @warning The behavior is undefined if `is_iconhash() == false` * @return iconhash& This iconhash */ iconhash&& as_iconhash() &&; @@ -539,7 +540,7 @@ struct icon { /** * @brief Get as image data. * - * @warn The behavior is undefined if `is_image_data() == false` + * @warning The behavior is undefined if `is_image_data() == false` * @return image_data& This image */ image_data& as_image_data() &; @@ -547,7 +548,7 @@ struct icon { /** * @brief Get as image. * - * @warn The behavior is undefined if `is_image_data() == false` + * @warning The behavior is undefined if `is_image_data() == false` * @return image_data& This image */ const image_data& as_image_data() const&; @@ -555,7 +556,7 @@ struct icon { /** * @brief Get as image. * - * @warn The behavior is undefined if `is_image_data() == false` + * @warning The behavior is undefined if `is_image_data() == false` * @return image_data& This image */ image_data&& as_image_data() &&; diff --git a/src/dpp/cluster_coro_calls.cpp b/src/dpp/cluster_coro_calls.cpp index 4b3d2287fa..dbf3da3757 100644 --- a/src/dpp/cluster_coro_calls.cpp +++ b/src/dpp/cluster_coro_calls.cpp @@ -503,6 +503,10 @@ async cluster::co_message_edit(const message &m) { return async{ this, static_cast(&cluster::message_edit), m }; } +async cluster::co_message_edit_flags(const message &m) { + return async{ this, static_cast(&cluster::message_edit_flags), m }; +} + async cluster::co_message_get(snowflake message_id, snowflake channel_id) { return async{ this, static_cast(&cluster::message_get), message_id, channel_id }; } diff --git a/src/dpp/cluster_sync_calls.cpp b/src/dpp/cluster_sync_calls.cpp index a19ec593fc..3dc14c2201 100644 --- a/src/dpp/cluster_sync_calls.cpp +++ b/src/dpp/cluster_sync_calls.cpp @@ -501,6 +501,10 @@ message cluster::message_edit_sync(const message &m) { return dpp::sync(this, static_cast(&cluster::message_edit), m); } +message cluster::message_edit_flags_sync(const message &m) { + return dpp::sync(this, static_cast(&cluster::message_edit_flags), m); +} + message cluster::message_get_sync(snowflake message_id, snowflake channel_id) { return dpp::sync(this, static_cast(&cluster::message_get), message_id, channel_id); }