Skip to content

Commit

Permalink
Merge pull request #47 from brainboxdotcc/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
Commandserver authored Jan 20, 2023
2 parents 1e5bd58 + 6c4ab32 commit adb6350
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 8 deletions.
5 changes: 4 additions & 1 deletion include/dpp/cluster.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);

Expand Down
5 changes: 3 additions & 2 deletions include/dpp/cluster_coro_calls.h
Original file line number Diff line number Diff line change
Expand Up @@ -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); });
}

/**
Expand Down
3 changes: 2 additions & 1 deletion include/dpp/cluster_sync_calls.h
Original file line number Diff line number Diff line change
Expand Up @@ -774,14 +774,15 @@ 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
* @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.
*/
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
Expand Down
2 changes: 1 addition & 1 deletion include/dpp/integration.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<integration> integrations; //!< Optional: an array of partial server integrations
bool verified; //!< whether the connection is verified
Expand Down
2 changes: 2 additions & 0 deletions include/dpp/message.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};

/**
Expand Down
3 changes: 2 additions & 1 deletion src/dpp/cluster/guild.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<auditlog>(this, API_PATH "/guilds", std::to_string(guild_id), "audit-logs" + parameters, m_get, "", callback);
Expand Down
4 changes: 2 additions & 2 deletions src/dpp/cluster_sync_calls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,8 @@ confirmation cluster::guild_current_member_edit_sync(snowflake guild_id, const s
return dpp::sync<confirmation>(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<auditlog>(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<auditlog>(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) {
Expand Down

0 comments on commit adb6350

Please sign in to comment.