Added checking / updating for race TotalLaps in case it gets shortened, i.e. due to rain.

This commit is contained in:
tamservo
2023-07-29 12:53:28 -04:00
parent 090230f11a
commit 12855df36d

View File

@@ -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():