Skip to content
Open
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
29 changes: 29 additions & 0 deletions include/dpp/permissions.h
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,22 @@ enum permissions : uint64_t {
*/
p_use_soundboard = 0x40000000000,

/**
* @brief Allows for creating emojis, stickers, and soundboard sounds, and editing and deleting those created by the current user.
*
* @note Not yet available to developers.
* @see https://discord.com/developers/docs/change-log#clarification-on-permission-splits-for-expressions-and-events
*/
p_create_guild_expressions = 0x80000000000,

/**
* @brief Allows for creating scheduled events, and editing and deleting those created by the current user.
*
* @note Not yet available to developers.
* @see https://discord.com/developers/docs/change-log#clarification-on-permission-splits-for-expressions-and-events
*/
p_create_events = 0x0000100000000000,

/**
* @brief Allows the usage of custom soundboard sounds from other servers.
*/
Expand All @@ -266,6 +282,19 @@ enum permissions : uint64_t {
*/
p_use_clyde_ai = 0x0000800000000000,

/**
* @brief Allows sending polls
*/
p_send_polls = 0x0002000000000000,

/**
* @brief Allows user-installed apps to send public responses.
* When disabled, users will still be allowed to use their apps but the responses will be ephemeral.
*
* @note This only applies to apps not also installed to the server.
*/
p_use_external_apps = 0x0004000000000000,

/**
* @brief Allows pinning and unpinning messages
*/
Expand Down
40 changes: 40 additions & 0 deletions include/dpp/role.h
Original file line number Diff line number Diff line change
Expand Up @@ -801,6 +801,28 @@ class DPP_EXPORT role : public managed, public json_interface<role> {
*/
bool has_use_soundboard() const;

/**
* @brief True if has the create guild expressions permission.
*
* @note Having the administrator permission causes this method to always return true
* Channel specific overrides may apply to permissions.
*
* @note Not yet available to developers.
* @return bool True if user has the create guild expressions permission or is administrator.
*/
bool has_create_guild_expressions() const;

/**
* @brief True if has the create events permission.
*
* @note Having the administrator permission causes this method to always return true
* Channel specific overrides may apply to permissions.
*
* @note Not yet available to developers.
* @return bool True if user has the create events permission or is administrator.
*/
bool has_create_events() const;

/**
* @brief True if has the use external sounds permission.
*
Expand Down Expand Up @@ -828,6 +850,24 @@ class DPP_EXPORT role : public managed, public json_interface<role> {
*/
bool has_use_clyde_ai() const;

/**
* @brief True if has the send polls 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 send polls permission or is administrator.
*/
bool has_send_polls() const;

/**
* @brief True if has the use external apps 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 use external apps permission or is administrator.
*/
bool has_use_external_apps() const;

/**
* @brief True if has permission to use pin messages.
*
Expand Down
16 changes: 16 additions & 0 deletions src/dpp/role.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,14 @@ bool role::has_use_soundboard() const {
return has_administrator() || permissions.has(p_use_soundboard);
}

bool role::has_create_guild_expressions() const {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need space between functions.

return has_administrator() || permissions.has(p_create_guild_expressions);
}

bool role::has_create_events() const {
return has_administrator() || permissions.has(p_create_events);
}

bool role::has_use_external_sounds() const {
return has_administrator() || permissions.has(p_use_external_sounds);
}
Expand All @@ -341,6 +349,14 @@ bool role::has_use_clyde_ai() const {
return has_administrator() || permissions.has(p_use_clyde_ai);
}

bool role::has_send_polls() const {
return has_administrator() || permissions.has(p_send_polls);
}

bool role::has_use_external_apps() const {
return has_administrator() || permissions.has(p_use_external_apps);
}

bool role::has_pin_messages() const {
return has_administrator() || permissions.has(p_pin_messages);
}
Expand Down
Loading