Changed to only report on the first notice of slippery conditions.

This commit is contained in:
tamservo 2023-07-29 13:07:56 -04:00
parent 0bcb1e488f
commit d761b59a77

View File

@ -125,6 +125,10 @@ class Robottas(commands.Bot):
elif category == "OTHER":
if self.session_type == "RACE" and "DELETED" in message['Message']:
pass
elif "SLIPPERY" in message['Message'] and \
not self.is_slippery_reported:
self.is_slippery_reported = True
report = "It's slippery out there!"
else:
report = message['Message']
@ -538,6 +542,7 @@ class Robottas(commands.Bot):
async def start_collect(self):
self.is_collecting = True
self.is_slippery_reported = False
dir_path = os.path.dirname(os.path.realpath(__file__))
command_txt = os.path.join(dir_path, self.collector_command)
command_txt += self.collector_params
@ -586,6 +591,9 @@ class Robottas(commands.Bot):
# Hold weather info
self.weather = ""
# Hold weather we have reported on slippery track.
self.is_slippery_reported = False
# Hold lap info
self.current_lap = -1000