From b5c4c988f01c9f07a48f23fcfcf6498812c61726 Mon Sep 17 00:00:00 2001 From: "tamservo@mx.sdf.org" Date: Tue, 13 Aug 2024 13:28:46 -0400 Subject: [PATCH] added \!in --- robottas.py | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/robottas.py b/robottas.py index b2047f1..b47e87d 100755 --- a/robottas.py +++ b/robottas.py @@ -178,6 +178,10 @@ class Robottas(commands.Bot): # i.e. shortened due to rain. if "TotalLaps" in data.keys(): self.total_laps = int(data["TotalLaps"]) + + #Check to see about sending half distance message + if self.current_lap > int(self.total_laps / 2): + await self.send_message("We've passed half distance! Has Lance binned it yet?") # Notify on lap change if matches a driver key = str(self.total_laps - int(current_lap)) if key in self.driver_dict.keys(): @@ -477,18 +481,32 @@ class Robottas(commands.Bot): except: return [] + def clear_messages_from_db(self): + try: + con = sqlite3.connect(self.dbfile) + cur = con.cursor() + cur.execute('delete from messges') + con.commit() + cur.close() + con.close() + except: + pass + async def _race_report(self, ctx): + self.clear_messages_from_db() self.report_deleted_lap = False self.session_type = 'RACE' await self._report(ctx) async def _quali_report(self, ctx): + self.clear_messages_from_db() self.report_deleted_lap = True self.session_type = 'QUALI' await self._report(ctx) async def _practice_report(self, ctx): + self.clear_messages_from_db() self.report_deleted_lap = True self.session_type = 'PRACTICE' await self._report(ctx) @@ -609,6 +627,7 @@ class Robottas(commands.Bot): try: if self.collector_proc != None: self.collector_proc.kill() + self.clear_messages_from_db() except: pass @@ -1010,10 +1029,12 @@ class Robottas(commands.Bot): " !bwoken - it's bwoken\n" + " !calm - keep calm but come on.\n" + " !censored\n" + + " !ciao\n" + " !forecast - what happened to that podium...\n" + " !grandma\n" + " !grass\n" + " !hard\n" + + " !in - in in in in in\n" + " !liked\n" + " !no\n" + " !noengine\n" + @@ -1021,6 +1042,7 @@ class Robottas(commands.Bot): " !paddock\n" + " !penalty\n" + " !ricky\n" + + " !rude - Charles thinks it's rude.\n" + " !stupid\n" + " !undercut\n" + " !wall - Lance is in the wall") @@ -1241,6 +1263,10 @@ class Robottas(commands.Bot): async def censored(ctx): await self.send_image(ctx, "images/censored.png") + @self.command() + async def ciao(ctx): + await self.send_image(ctx, "images/ciao.png") + @self.command() async def grandma(ctx): await self.send_image(ctx, "images/grandma.png") @@ -1257,6 +1283,10 @@ class Robottas(commands.Bot): async def hard(ctx): await self.send_image(ctx, "images/hard.gif") + @self.command() + async def in(ctx): + await self.send_image(ctx, "images/in.png") + @self.command() async def liked(ctx): await self.send_image(ctx, "images/liked.png") @@ -1286,6 +1316,10 @@ class Robottas(commands.Bot): async def ricky(ctx): await self.send_image(ctx, "images/ricky.gif") + @self.command() + async def rude(ctx): + await self.send_image(ctx, "images/rude.mp4") + @self.command() async def stupid(ctx): await self.send_image(ctx, "images/stupid.png")