Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions include/dpp/permissions.h
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,11 @@ enum permissions : uint64_t {
* @brief Allows pinning and unpinning messages
*/
p_pin_messages = 0x0008000000000000,

/**
* @brief Allows members to bypass the slow mode rate limit for sending messages in a channel.
*/
p_bypass_slowmode = 0x0010000000000000,
};

/**
Expand Down
9 changes: 9 additions & 0 deletions include/dpp/role.h
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,15 @@ class DPP_EXPORT role : public managed, public json_interface<role> {
*/
bool has_pin_messages() const;

/**
* @brief True if has the bypass slow mode permission.
*
* @note Having the administrator permission causes this method to always return true
* Channel specific overrides may apply to permissions.
* @return bool True if user has the bypass slow mode permission or is administrator.
*/
bool has_bypass_slowmode() const;

/**
* @brief Get guild members who have this role.
*
Expand Down
4 changes: 4 additions & 0 deletions src/dpp/role.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,10 @@ bool role::has_pin_messages() const {
return has_administrator() || permissions.has(p_pin_messages);
}

bool role::has_bypass_slowmode() const {
return has_administrator() || permissions.has(p_bypass_slowmode);
}

role& role::set_name(const std::string& n) {
name = utility::validate(n, 1, 100, "Role name too short");
return *this;
Expand Down
Loading