diff --git a/robottas.py b/robottas.py index 80ef5e9..a7b24ce 100755 --- a/robottas.py +++ b/robottas.py @@ -158,6 +158,11 @@ class Robottas(commands.Bot): if self.current_lap != current_lap: self.current_lap = current_lap + + #Re-evaluate total laps in case it has changed + #i.e. shortened due to rain. + if "TotalLaps" in data.keys(): + self.total_laps = int(data["TotalLaps"]) #Notify on lap change if matches a driver key = str(self.total_laps - int(current_lap)) if key in self.driver_dict.keys():