Skip to content

Commit

Permalink
breaking: delete message count on cluster::guild_ban_add is now sca…
Browse files Browse the repository at this point in the history
…led in seconds instead of days (#489)
  • Loading branch information
braindigitalis authored Aug 31, 2022
2 parents df09b85 + 53cb5a8 commit 965e322
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions include/dpp/cluster.h
Original file line number Diff line number Diff line change
Expand Up @@ -2352,11 +2352,11 @@ class DPP_EXPORT cluster {
* @note This method supports audit log reasons set by the cluster::set_audit_reason() method.
* @param guild_id Guild ID to add ban to
* @param user_id User ID to ban
* @param delete_message_days How many days of their user's messages to also delete (0-7). Defaults to 0
* @param delete_message_seconds How many seconds to delete messages for, between 0 and 604800 (7 days). Defaults to 0
* @param callback Function to call when the API call completes.
* On success the callback will contain a dpp::confirmation 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_ban_add(snowflake guild_id, snowflake user_id, uint32_t delete_message_days = 0, command_completion_event_t callback = utility::log_error());
void guild_ban_add(snowflake guild_id, snowflake user_id, uint32_t delete_message_seconds = 0, command_completion_event_t callback = utility::log_error());

/**
* @brief Delete guild ban
Expand Down
6 changes: 3 additions & 3 deletions src/dpp/cluster/guild.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ void cluster::guild_auditlog_get(snowflake guild_id, snowflake user_id, uint32_t
}


void cluster::guild_ban_add(snowflake guild_id, snowflake user_id, uint32_t delete_message_days, command_completion_event_t callback) {
void cluster::guild_ban_add(snowflake guild_id, snowflake user_id, uint32_t delete_message_seconds, command_completion_event_t callback) {
json j;
if (delete_message_days)
j["delete_message_days"] = delete_message_days > 7 ? 7 : delete_message_days;
if (delete_message_seconds)
j["delete_message_seconds"] = delete_message_seconds > 604800 ? 604800 : delete_message_seconds;
rest_request<confirmation>(this, API_PATH "/guilds", std::to_string(guild_id), "bans/" + std::to_string(user_id), m_put, j.dump(), callback);
}

Expand Down

0 comments on commit 965e322

Please sign in to comment.