diff --git a/include/dpp/permissions.h b/include/dpp/permissions.h index 2426e9e6e2..a442edd08b 100644 --- a/include/dpp/permissions.h +++ b/include/dpp/permissions.h @@ -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. */ @@ -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 */ diff --git a/include/dpp/role.h b/include/dpp/role.h index 4fc4c5a7df..a152ae56bd 100644 --- a/include/dpp/role.h +++ b/include/dpp/role.h @@ -801,6 +801,28 @@ class DPP_EXPORT role : public managed, public json_interface { */ 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. * @@ -828,6 +850,24 @@ class DPP_EXPORT role : public managed, public json_interface { */ 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. * diff --git a/src/dpp/role.cpp b/src/dpp/role.cpp index dff3f3cc2d..a74dd3e04e 100644 --- a/src/dpp/role.cpp +++ b/src/dpp/role.cpp @@ -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 { + 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); } @@ -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); }