From d3665b7f25019b0fbf163c38014fe2cd31935416 Mon Sep 17 00:00:00 2001 From: Hicster Date: Fri, 13 Sep 2024 17:18:37 -0500 Subject: [PATCH] Add `USE_EXTERNAL_APPS` permission (#2950) This adds Discord's new permission `USE_EXTERNAL_APPS` at bit 50. --- src/model/permissions.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/model/permissions.rs b/src/model/permissions.rs index b4fa0248f8d..16e90f6113b 100644 --- a/src/model/permissions.rs +++ b/src/model/permissions.rs @@ -364,6 +364,8 @@ bitflags::bitflags! { const SET_VOICE_CHANNEL_STATUS = 1 << 48; /// Allows attaching polls to message sends. const SEND_POLLS = 1 << 49; + /// Allows user-installed apps to send public responses. + const USE_EXTERNAL_APPS = 1 << 50; } } @@ -810,6 +812,14 @@ impl Permissions { pub const fn send_polls(self) -> bool { self.contains(Self::SEND_POLLS) } + /// Shorthand for checking that the set of permissions contains the [Use External Apps] + /// permission. + /// + /// [Use External Apps]: Self::USE_EXTERNAL_APPS + #[must_use] + pub const fn use_external_apps(self) -> bool { + self.contains(Self::USE_EXTERNAL_APPS) + } } // Manual impl needed because Permissions are usually sent as a stringified integer,