mirror of
https://git.sdf.org/tamservo/robottas.git
synced 2025-11-08 07:03:47 -05:00
Added checking / updating for race TotalLaps in case it gets shortened, i.e. due to rain.
This commit is contained in:
@@ -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():
|
||||
|
||||
Reference in New Issue
Block a user