diff --git a/include/dpp/cluster.h b/include/dpp/cluster.h index bb1a8cbab0..f9f1d07e59 100644 --- a/include/dpp/cluster.h +++ b/include/dpp/cluster.h @@ -1297,11 +1297,12 @@ class DPP_EXPORT cluster { * @param user_id Entries from a specific user ID. Set this to `0` will fetch any user * @param action_type Entries for a specific dpp::audit_type. Set this to `0` will fetch any type * @param before Entries that preceded a specific audit log entry ID. Used for paginating + * @param after Entries that succeeded a specific audit log entry ID. Used for paginating * @param limit Maximum number of entries (between 1-100) to return * @param callback Function to call when the API call completes. * On success the callback will contain a dpp::auditlog object in confirmation_callback_t::value. 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(). */ - void guild_auditlog_get(snowflake guild_id, snowflake user_id, uint32_t action_type, snowflake before, uint32_t limit, command_completion_event_t callback); + void guild_auditlog_get(snowflake guild_id, snowflake user_id, uint32_t action_type, snowflake before, snowflake after, uint32_t limit, command_completion_event_t callback); /** * @brief Create a slash command local to a guild @@ -2463,6 +2464,8 @@ class DPP_EXPORT cluster { * @param guild_id Guild ID to get integrations for * @param callback Function to call when the API call completes. * On success the callback will contain a dpp::integration_map object in confirmation_callback_t::value. 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(). + * + * @note This endpoint returns a maximum of 50 integrations. If a guild has more integrations, they cannot be accessed. */ void guild_get_integrations(snowflake guild_id, command_completion_event_t callback); diff --git a/include/dpp/cluster_coro_calls.h b/include/dpp/cluster_coro_calls.h index aaf4afa6f7..cf5b959493 100644 --- a/include/dpp/cluster_coro_calls.h +++ b/include/dpp/cluster_coro_calls.h @@ -724,12 +724,13 @@ auto inline co_guild_current_member_edit(snowflake guild_id, const std::string & * @param user_id Entries from a specific user ID. Set this to `0` will fetch any user * @param action_type Entries for a specific dpp::audit_type. Set this to `0` will fetch any type * @param before Entries that preceded a specific audit log entry ID. Used for paginating + * @param after Entries that succeeded a specific audit log entry ID. Used for paginating * @param limit Maximum number of entries (between 1-100) to return * @return auditlog returned object on completion * \memberof dpp::cluster */ -auto inline co_guild_auditlog_get(snowflake guild_id, snowflake user_id, uint32_t action_type, snowflake before, uint32_t limit) { - return dpp::awaitable(this, [&] (auto cc) { this->guild_auditlog_get(guild_id, user_id, action_type, before, limit, cc); }); +auto inline co_guild_auditlog_get(snowflake guild_id, snowflake user_id, uint32_t action_type, snowflake before, snowflake after, uint32_t limit) { + return dpp::awaitable(this, [&] (auto cc) { this->guild_auditlog_get(guild_id, user_id, action_type, before, after, limit, cc); }); } /** diff --git a/include/dpp/cluster_sync_calls.h b/include/dpp/cluster_sync_calls.h index 44dd073ecb..ae61fd1877 100644 --- a/include/dpp/cluster_sync_calls.h +++ b/include/dpp/cluster_sync_calls.h @@ -774,6 +774,7 @@ confirmation guild_current_member_edit_sync(snowflake guild_id, const std::strin * @param user_id Entries from a specific user ID. Set this to `0` will fetch any user * @param action_type Entries for a specific dpp::audit_type. Set this to `0` will fetch any type * @param before Entries that preceded a specific audit log entry ID. Used for paginating + * @param after Entries that succeeded a specific audit log entry ID. Used for paginating * @param limit Maximum number of entries (between 1-100) to return * @return auditlog returned object on completion * \memberof dpp::cluster @@ -781,7 +782,7 @@ confirmation guild_current_member_edit_sync(snowflake guild_id, const std::strin * @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. */ -auditlog guild_auditlog_get_sync(snowflake guild_id, snowflake user_id, uint32_t action_type, snowflake before, uint32_t limit); +auditlog guild_auditlog_get_sync(snowflake guild_id, snowflake user_id, uint32_t action_type, snowflake before, snowflake after, uint32_t limit); /** * @brief Add guild ban diff --git a/include/dpp/integration.h b/include/dpp/integration.h index a1de296193..dba58a9465 100644 --- a/include/dpp/integration.h +++ b/include/dpp/integration.h @@ -139,7 +139,7 @@ class DPP_EXPORT connection { public: std::string id; //!< id of the connection account std::string name; //!< the username of the connection account - std::string type; //!< the service of the connection (twitch, youtube) + std::string type; //!< the service of the connection (twitch, youtube, discord, or guild_subscription) bool revoked; //!< Optional: whether the connection is revoked std::vector integrations; //!< Optional: an array of partial server integrations bool verified; //!< whether the connection is verified diff --git a/include/dpp/message.h b/include/dpp/message.h index fb65d8824e..2c0d18f3aa 100644 --- a/include/dpp/message.h +++ b/include/dpp/message.h @@ -1069,6 +1069,8 @@ enum message_type { mt_context_menu_command = 23, /// Auto moderation action mt_auto_moderation_action = 24, + /// Role subscription purchase + mt_role_subscription_purchase = 25, }; /** diff --git a/src/dpp/cluster/guild.cpp b/src/dpp/cluster/guild.cpp index 183c622c60..4a701eb84c 100644 --- a/src/dpp/cluster/guild.cpp +++ b/src/dpp/cluster/guild.cpp @@ -29,11 +29,12 @@ void cluster::guild_current_member_edit(snowflake guild_id, const std::string &n } -void cluster::guild_auditlog_get(snowflake guild_id, snowflake user_id, uint32_t action_type, snowflake before, uint32_t limit, command_completion_event_t callback) { +void cluster::guild_auditlog_get(snowflake guild_id, snowflake user_id, uint32_t action_type, snowflake before, snowflake after, uint32_t limit, command_completion_event_t callback) { std::string parameters = utility::make_url_parameters({ {"user_id", user_id}, {"action_type", action_type}, {"before", before}, + {"after", after}, {"limit", limit}, }); rest_request(this, API_PATH "/guilds", std::to_string(guild_id), "audit-logs" + parameters, m_get, "", callback); diff --git a/src/dpp/cluster_sync_calls.cpp b/src/dpp/cluster_sync_calls.cpp index 4f6db48726..d1f473353a 100644 --- a/src/dpp/cluster_sync_calls.cpp +++ b/src/dpp/cluster_sync_calls.cpp @@ -233,8 +233,8 @@ confirmation cluster::guild_current_member_edit_sync(snowflake guild_id, const s return dpp::sync(this, &cluster::guild_current_member_edit, guild_id, nickname); } -auditlog cluster::guild_auditlog_get_sync(snowflake guild_id, snowflake user_id, uint32_t action_type, snowflake before, uint32_t limit) { - return dpp::sync(this, &cluster::guild_auditlog_get, guild_id, user_id, action_type, before, limit); +auditlog cluster::guild_auditlog_get_sync(snowflake guild_id, snowflake user_id, uint32_t action_type, snowflake before, snowflake after, uint32_t limit) { + return dpp::sync(this, &cluster::guild_auditlog_get, guild_id, user_id, action_type, before, after, limit); } confirmation cluster::guild_ban_add_sync(snowflake guild_id, snowflake user_id, uint32_t delete_message_seconds) {