@@ -36,9 +36,9 @@ def __init__(self, client: discord.Client, api_key: str, debug: bool = False):
3636 "date" : datetime .today ().strftime ("%Y-%m-%d" ),
3737 "guilds" : 0 ,
3838 "users" : 0 ,
39- "interactions" : [],
40- "locales" : [],
41- "guildsLocales" : [],
39+ "interactions" : [], # {name:str, number:int, type:int}[]
40+ "locales" : [], # {locale:str, number:int}[]
41+ "guildsLocales" : [], # {locale:str, number:int}[]
4242 "guildMembers" : {
4343 "little" : 0 ,
4444 "medium" : 0 ,
@@ -163,51 +163,51 @@ def track_interactions(self, interaction):
163163 found = False
164164 for g in guilds :
165165 if g ["locale" ] == guild .preferred_locale .value :
166- g ["count " ] += 1
166+ g ["number " ] += 1
167167 found = True
168168 break
169169 if not found :
170170 guilds .append ({
171171 "locale" : guild .preferred_locale .value ,
172- "count " : 1
172+ "number " : 1
173173 })
174174 self .stats ["guildsLocales" ] = guilds
175175
176176 found = False
177177 for data in self .stats ["locales" ]:
178178 if data ["locale" ] == interaction .locale .value :
179- data ["count " ] += 1
179+ data ["number " ] += 1
180180 found = True
181181 break
182182 if not found :
183183 self .stats ["locales" ].append ({
184184 "locale" : interaction .locale .value ,
185- "count " : 1
185+ "number " : 1
186186 })
187187
188188 if interaction .type == InteractionType .application_command or interaction .type == InteractionType .autocomplete :
189189 found = False
190190 for data in self .stats ["interactions" ]:
191191 if data ["name" ] == interaction .data ["name" ] and data ["type" ] == interaction .type .value :
192- data ["count " ] += 1
192+ data ["number " ] += 1
193193 found = True
194194 break
195195 if not found :
196196 self .stats ["interactions" ].append ({
197197 "name" : interaction .data ["name" ],
198- "count " : 1 ,
198+ "number " : 1 ,
199199 "type" : interaction .type .value
200200 })
201201 elif interaction .type == InteractionType .component or interaction .type == InteractionType .modal_submit :
202202 found = False
203203 for data in self .stats ["interactions" ]:
204204 if data ["name" ] == interaction .data ["custom_id" ] and data ["type" ] == interaction .type .value :
205- data ["count " ] += 1
205+ data ["number " ] += 1
206206 found = True
207207 break
208208 if not found :
209209 self .stats ["interactions" ].append ({
210210 "name" : interaction .data ["custom_id" ],
211- "count " : 1 ,
211+ "number " : 1 ,
212212 "type" : interaction .type .value
213213 })
0 commit comments