File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- use super :: { InteractionData , InteractionDataType , InteractionType } ;
1+ use super :: { InteractionData , InteractionType } ;
22use crate :: models:: serde_helpers:: { deserialize_string_or_number, is_default} ;
33use serde:: { Deserialize , Serialize } ;
44use serde_json:: Value ;
@@ -71,33 +71,6 @@ impl Interaction {
7171 version : wire. version ,
7272 }
7373 }
74-
75- /// Check if this is a button interaction
76- pub fn is_button_interaction ( & self ) -> bool {
77- matches ! (
78- self . data. data_type,
79- Some ( InteractionDataType :: InlineKeyboardButtonClick )
80- )
81- }
82-
83- /// Check if this is a command interaction
84- pub fn is_command_interaction ( & self ) -> bool {
85- matches ! (
86- self . interaction_type,
87- Some ( InteractionType :: ApplicationCommand )
88- )
89- }
90-
91- /// Get the button ID if this is a button interaction
92- pub fn button_id ( & self ) -> Option < & str > {
93- ( !self . data . resolved . button_id . is_empty ( ) ) . then_some ( self . data . resolved . button_id . as_str ( ) )
94- }
95-
96- /// Get the button data if this is a button interaction
97- pub fn button_data ( & self ) -> Option < & str > {
98- ( !self . data . resolved . button_data . is_empty ( ) )
99- . then_some ( self . data . resolved . button_data . as_str ( ) )
100- }
10174}
10275
10376impl std:: fmt:: Display for Interaction {
You can’t perform that action at this time.
0 commit comments