diff --git a/src/model/application/command_interaction.rs b/src/model/application/command_interaction.rs index f5dd7bb3319..119ea2d0d6a 100644 --- a/src/model/application/command_interaction.rs +++ b/src/model/application/command_interaction.rs @@ -55,8 +55,7 @@ pub struct CommandInteraction { /// Always `1`. pub version: u8, /// Permissions the app or bot has within the channel the interaction was sent from. - // TODO(next): This is now always serialized. - pub app_permissions: Option, + pub app_permissions: Permissions, /// The selected language of the invoking user. pub locale: FixedString, /// The guild's preferred locale. diff --git a/src/model/application/component_interaction.rs b/src/model/application/component_interaction.rs index f3565cf1e04..cbdac72d92b 100644 --- a/src/model/application/component_interaction.rs +++ b/src/model/application/component_interaction.rs @@ -53,7 +53,7 @@ pub struct ComponentInteraction { /// The message this interaction was triggered by, if it is a component. pub message: Box, /// Permissions the app or bot has within the channel the interaction was sent from. - pub app_permissions: Option, + pub app_permissions: Permissions, /// The selected language of the invoking user. pub locale: FixedString, /// The guild's preferred locale. diff --git a/src/model/application/interaction.rs b/src/model/application/interaction.rs index 22da1cd887f..a366082fbda 100644 --- a/src/model/application/interaction.rs +++ b/src/model/application/interaction.rs @@ -56,9 +56,9 @@ impl Interaction { /// Permissions the app or bot has within the channel the interaction was sent from. #[must_use] - pub fn app_permissions(&self) -> Option { + pub fn app_permissions(&self) -> Permissions { match self { - Self::Ping(_) => None, + Self::Ping(i) => i.app_permissions, Self::Command(i) | Self::Autocomplete(i) => i.app_permissions, Self::Component(i) => i.app_permissions, Self::Modal(i) => i.app_permissions, diff --git a/src/model/application/modal_interaction.rs b/src/model/application/modal_interaction.rs index ee3cfb3a438..e26b22da3bc 100644 --- a/src/model/application/modal_interaction.rs +++ b/src/model/application/modal_interaction.rs @@ -51,7 +51,7 @@ pub struct ModalInteraction { #[serde(skip_serializing_if = "Option::is_none")] pub message: Option>, /// Permissions the app or bot has within the channel the interaction was sent from. - pub app_permissions: Option, + pub app_permissions: Permissions, /// The selected language of the invoking user. pub locale: FixedString, /// The guild's preferred locale. diff --git a/src/model/application/ping_interaction.rs b/src/model/application/ping_interaction.rs index d10e605572f..0a713208a7e 100644 --- a/src/model/application/ping_interaction.rs +++ b/src/model/application/ping_interaction.rs @@ -17,4 +17,6 @@ pub struct PingInteraction { pub token: FixedString, /// Always `1`. pub version: u8, + /// Permissions the app or bot has within the channel the interaction was sent from. + pub app_permissions: Permissions, }