@@ -36,7 +36,7 @@ def __init__(self, client: discord.Client, api_key: str, debug: bool = False, ch
3636 "date" : datetime .today ().strftime ("%Y-%m-%d" ),
3737 "guilds" : 0 ,
3838 "users" : 0 ,
39- "interactions" : [], # {name:str, number:int, type:int}[]
39+ "interactions" : [], # {name:str, number:int, type:int command_type?:int }[]
4040 "locales" : [], # {locale:str, number:int}[]
4141 "guildsLocales" : [], # {locale:str, number:int}[]
4242 "guildMembers" : {
@@ -236,14 +236,15 @@ def track_interactions(self, interaction: discord.Interaction):
236236
237237 if interaction .type in {InteractionType .application_command , InteractionType .autocomplete }:
238238 interaction_data = next ((x for x in self .stats ["interactions" ]
239- if x ["name" ] == interaction .data ["name" ] and x ["type" ] == interaction .type .value ), None )
239+ if x ["name" ] == interaction .data ["name" ] and x ["type" ] == interaction .type .value and x [ "command_type" ] == interaction . data [ "type" ] ), None )
240240 if interaction_data is not None :
241241 interaction_data ["number" ] += 1
242242 else :
243243 self .stats ["interactions" ].append ({
244244 "name" : interaction .data ["name" ],
245245 "number" : 1 ,
246- "type" : interaction .type .value
246+ "type" : interaction .type .value ,
247+ "command_type" : interaction .data ["type" ]
247248 })
248249 elif interaction .type in {InteractionType .component , InteractionType .modal_submit }:
249250 interaction_data = next ((x for x in self .stats ["interactions" ]
0 commit comments