@@ -82,7 +82,7 @@ def handle_round_countdown(self, *args, **kwargs):
8282 def f ():
8383 self .execute_suggestion ()
8484 f ()
85-
85+
8686 self .in_countdown = True
8787
8888 def handle_round_start (self , * args , ** kwargs ):
@@ -100,7 +100,7 @@ def f():
100100 if len (players ["red" ] + players ["blue" ]) % 2 != 0 :
101101 self .msg ("Teams were ^6NOT^7 balanced due to the total number of players being an odd number." )
102102 return
103-
103+
104104 players = dict ([(p .steam_id , gt ) for p in players ["red" ] + players ["blue" ]])
105105 self .add_request (players , self .callback_balance , minqlx .CHAT_CHANNEL )
106106 f ()
@@ -166,7 +166,7 @@ def fetch_ratings(self, players, request_id):
166166 last_status = res .status_code
167167 if res .status_code != requests .codes .ok :
168168 continue
169-
169+
170170 js = res .json ()
171171 if "players" not in js :
172172 last_status = - 1
@@ -181,14 +181,14 @@ def fetch_ratings(self, players, request_id):
181181 with self .ratings_lock :
182182 if sid not in self .ratings :
183183 self .ratings [sid ] = {}
184-
184+
185185 for gt in p :
186186 p [gt ]["time" ] = t
187187 p [gt ]["local" ] = False
188188 self .ratings [sid ][gt ] = p [gt ]
189189 if self .ratings [sid ][gt ]["elo" ] == 0 and self .ratings [sid ][gt ]["games" ] == 0 :
190190 self .ratings [sid ][gt ]["elo" ] = DEFAULT_RATING
191-
191+
192192 if sid in players and gt == players [sid ]:
193193 # The API gave us the game type we wanted, so we remove it.
194194 del players [sid ]
@@ -304,13 +304,13 @@ def callback_getrating(self, players, channel, gametype):
304304 name = player .name
305305 else :
306306 name = sid
307-
307+
308308 channel .reply ("{} has a rating of ^6{}^7 in {}." .format (name , self .ratings [sid ][gametype ]["elo" ], gametype .upper ()))
309309
310310 def cmd_setrating (self , player , msg , channel ):
311311 if len (msg ) < 3 :
312312 return minqlx .RET_USAGE
313-
313+
314314 try :
315315 sid = int (msg [1 ])
316316 target_player = None
@@ -323,7 +323,7 @@ def cmd_setrating(self, player, msg, channel):
323323 except minqlx .NonexistentPlayerError :
324324 player .tell ("Invalid client ID. Use either a client ID or a SteamID64." )
325325 return minqlx .RET_STOP_ALL
326-
326+
327327 try :
328328 rating = int (msg [2 ])
329329 except ValueError :
@@ -334,7 +334,7 @@ def cmd_setrating(self, player, msg, channel):
334334 name = target_player .name
335335 else :
336336 name = sid
337-
337+
338338 gt = self .game .type_short
339339 self .db [RATING_KEY .format (sid , gt )] = rating
340340
@@ -350,7 +350,7 @@ def cmd_setrating(self, player, msg, channel):
350350 def cmd_remrating (self , player , msg , channel ):
351351 if len (msg ) < 2 :
352352 return minqlx .RET_USAGE
353-
353+
354354 try :
355355 sid = int (msg [1 ])
356356 target_player = None
@@ -363,12 +363,12 @@ def cmd_remrating(self, player, msg, channel):
363363 except minqlx .NonexistentPlayerError :
364364 player .tell ("Invalid client ID. Use either a client ID or a SteamID64." )
365365 return minqlx .RET_STOP_ALL
366-
366+
367367 if target_player :
368368 name = target_player .name
369369 else :
370370 name = sid
371-
371+
372372 gt = self .game .type_short
373373 del self .db [RATING_KEY .format (sid , gt )]
374374
@@ -389,7 +389,7 @@ def cmd_balance(self, player, msg, channel):
389389 if len (teams ["red" ] + teams ["blue" ]) % 2 != 0 :
390390 player .tell ("The total number of players should be an even number." )
391391 return minqlx .RET_STOP_ALL
392-
392+
393393 players = dict ([(p .steam_id , gt ) for p in teams ["red" ] + teams ["blue" ]])
394394 self .add_request (players , self .callback_balance , minqlx .CHAT_CHANNEL )
395395
@@ -453,12 +453,12 @@ def cmd_teams(self, player, msg, channel):
453453 if gt not in SUPPORTED_GAMETYPES :
454454 player .tell ("This game mode is not supported by the balance plugin." )
455455 return minqlx .RET_STOP_ALL
456-
456+
457457 teams = self .teams ()
458458 if len (teams ["red" ]) != len (teams ["blue" ]):
459459 player .tell ("Both teams should have the same number of players." )
460460 return minqlx .RET_STOP_ALL
461-
461+
462462 teams = dict ([(p .steam_id , gt ) for p in teams ["red" ] + teams ["blue" ]])
463463 self .add_request (teams , self .callback_teams , channel )
464464
@@ -514,7 +514,7 @@ def cmd_agree(self, player, msg, channel):
514514 """After the bot suggests a switch, players in question can use this to agree to the switch."""
515515 if self .suggested_pair and not all (self .suggested_agree ):
516516 p1 , p2 = self .suggested_pair
517-
517+
518518 if p1 == player :
519519 self .suggested_agree [0 ] = True
520520 elif p2 == player :
@@ -534,7 +534,7 @@ def cmd_ratings(self, player, msg, channel):
534534 if gt not in EXT_SUPPORTED_GAMETYPES :
535535 player .tell ("This game mode is not supported by the balance plugin." )
536536 return minqlx .RET_STOP_ALL
537-
537+
538538 players = dict ([(p .steam_id , gt ) for p in self .players ()])
539539 self .add_request (players , self .callback_ratings , channel )
540540
@@ -612,9 +612,9 @@ def execute_suggestion(self):
612612 p2 .update ()
613613 except minqlx .NonexistentPlayerError :
614614 return
615-
615+
616616 if p1 .team != "spectator" and p2 .team != "spectator" :
617617 self .switch (self .suggested_pair [0 ], self .suggested_pair [1 ])
618-
618+
619619 self .suggested_pair = None
620620 self .suggested_agree = [False , False ]
0 commit comments