File tree Expand file tree Collapse file tree 5 files changed +7
-6
lines changed Expand file tree Collapse file tree 5 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -55,8 +55,7 @@ pub struct CommandInteraction {
5555 /// Always `1`.
5656 pub version : u8 ,
5757 /// Permissions the app or bot has within the channel the interaction was sent from.
58- // TODO(next): This is now always serialized.
59- pub app_permissions : Option < Permissions > ,
58+ pub app_permissions : Permissions ,
6059 /// The selected language of the invoking user.
6160 pub locale : FixedString ,
6261 /// The guild's preferred locale.
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ pub struct ComponentInteraction {
5353 /// The message this interaction was triggered by, if it is a component.
5454 pub message : Box < Message > ,
5555 /// Permissions the app or bot has within the channel the interaction was sent from.
56- pub app_permissions : Option < Permissions > ,
56+ pub app_permissions : Permissions ,
5757 /// The selected language of the invoking user.
5858 pub locale : FixedString ,
5959 /// The guild's preferred locale.
Original file line number Diff line number Diff line change @@ -56,9 +56,9 @@ impl Interaction {
5656
5757 /// Permissions the app or bot has within the channel the interaction was sent from.
5858 #[ must_use]
59- pub fn app_permissions ( & self ) -> Option < Permissions > {
59+ pub fn app_permissions ( & self ) -> Permissions {
6060 match self {
61- Self :: Ping ( _ ) => None ,
61+ Self :: Ping ( i ) => i . app_permissions ,
6262 Self :: Command ( i) | Self :: Autocomplete ( i) => i. app_permissions ,
6363 Self :: Component ( i) => i. app_permissions ,
6464 Self :: Modal ( i) => i. app_permissions ,
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ pub struct ModalInteraction {
5151 #[ serde( skip_serializing_if = "Option::is_none" ) ]
5252 pub message : Option < Box < Message > > ,
5353 /// Permissions the app or bot has within the channel the interaction was sent from.
54- pub app_permissions : Option < Permissions > ,
54+ pub app_permissions : Permissions ,
5555 /// The selected language of the invoking user.
5656 pub locale : FixedString ,
5757 /// The guild's preferred locale.
Original file line number Diff line number Diff line change @@ -17,4 +17,6 @@ pub struct PingInteraction {
1717 pub token : FixedString ,
1818 /// Always `1`.
1919 pub version : u8 ,
20+ /// Permissions the app or bot has within the channel the interaction was sent from.
21+ pub app_permissions : Permissions ,
2022}
You can’t perform that action at this time.
0 commit comments