mirror of
https://git.sdf.org/tamservo/robottas.git
synced 2025-11-08 07:03:47 -05:00
Compare commits
2 Commits
082c4c16b9
...
2f9b0af5d8
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2f9b0af5d8 | ||
|
|
b5c4c988f0 |
34
robottas.py
34
robottas.py
@@ -178,6 +178,10 @@ class Robottas(commands.Bot):
|
|||||||
# i.e. shortened due to rain.
|
# i.e. shortened due to rain.
|
||||||
if "TotalLaps" in data.keys():
|
if "TotalLaps" in data.keys():
|
||||||
self.total_laps = int(data["TotalLaps"])
|
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
|
# Notify on lap change if matches a driver
|
||||||
key = str(self.total_laps - int(current_lap))
|
key = str(self.total_laps - int(current_lap))
|
||||||
if key in self.driver_dict.keys():
|
if key in self.driver_dict.keys():
|
||||||
@@ -477,18 +481,32 @@ class Robottas(commands.Bot):
|
|||||||
except:
|
except:
|
||||||
return []
|
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):
|
async def _race_report(self, ctx):
|
||||||
|
self.clear_messages_from_db()
|
||||||
self.report_deleted_lap = False
|
self.report_deleted_lap = False
|
||||||
self.session_type = 'RACE'
|
self.session_type = 'RACE'
|
||||||
await self._report(ctx)
|
await self._report(ctx)
|
||||||
|
|
||||||
async def _quali_report(self, ctx):
|
async def _quali_report(self, ctx):
|
||||||
|
self.clear_messages_from_db()
|
||||||
self.report_deleted_lap = True
|
self.report_deleted_lap = True
|
||||||
self.session_type = 'QUALI'
|
self.session_type = 'QUALI'
|
||||||
|
|
||||||
await self._report(ctx)
|
await self._report(ctx)
|
||||||
|
|
||||||
async def _practice_report(self, ctx):
|
async def _practice_report(self, ctx):
|
||||||
|
self.clear_messages_from_db()
|
||||||
self.report_deleted_lap = True
|
self.report_deleted_lap = True
|
||||||
self.session_type = 'PRACTICE'
|
self.session_type = 'PRACTICE'
|
||||||
await self._report(ctx)
|
await self._report(ctx)
|
||||||
@@ -609,6 +627,7 @@ class Robottas(commands.Bot):
|
|||||||
try:
|
try:
|
||||||
if self.collector_proc != None:
|
if self.collector_proc != None:
|
||||||
self.collector_proc.kill()
|
self.collector_proc.kill()
|
||||||
|
self.clear_messages_from_db()
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@@ -1010,10 +1029,12 @@ class Robottas(commands.Bot):
|
|||||||
" !bwoken - it's bwoken\n" +
|
" !bwoken - it's bwoken\n" +
|
||||||
" !calm - keep calm but come on.\n" +
|
" !calm - keep calm but come on.\n" +
|
||||||
" !censored\n" +
|
" !censored\n" +
|
||||||
|
" !ciao\n" +
|
||||||
" !forecast - what happened to that podium...\n" +
|
" !forecast - what happened to that podium...\n" +
|
||||||
" !grandma\n" +
|
" !grandma\n" +
|
||||||
" !grass\n" +
|
" !grass\n" +
|
||||||
" !hard\n" +
|
" !hard\n" +
|
||||||
|
" !inin - in in in in in\n" +
|
||||||
" !liked\n" +
|
" !liked\n" +
|
||||||
" !no\n" +
|
" !no\n" +
|
||||||
" !noengine\n" +
|
" !noengine\n" +
|
||||||
@@ -1021,6 +1042,7 @@ class Robottas(commands.Bot):
|
|||||||
" !paddock\n" +
|
" !paddock\n" +
|
||||||
" !penalty\n" +
|
" !penalty\n" +
|
||||||
" !ricky\n" +
|
" !ricky\n" +
|
||||||
|
" !rude - Charles thinks it's rude.\n" +
|
||||||
" !stupid\n" +
|
" !stupid\n" +
|
||||||
" !undercut\n" +
|
" !undercut\n" +
|
||||||
" !wall - Lance is in the wall")
|
" !wall - Lance is in the wall")
|
||||||
@@ -1241,6 +1263,10 @@ class Robottas(commands.Bot):
|
|||||||
async def censored(ctx):
|
async def censored(ctx):
|
||||||
await self.send_image(ctx, "images/censored.png")
|
await self.send_image(ctx, "images/censored.png")
|
||||||
|
|
||||||
|
@self.command()
|
||||||
|
async def ciao(ctx):
|
||||||
|
await self.send_image(ctx, "images/ciao.png")
|
||||||
|
|
||||||
@self.command()
|
@self.command()
|
||||||
async def grandma(ctx):
|
async def grandma(ctx):
|
||||||
await self.send_image(ctx, "images/grandma.png")
|
await self.send_image(ctx, "images/grandma.png")
|
||||||
@@ -1257,6 +1283,10 @@ class Robottas(commands.Bot):
|
|||||||
async def hard(ctx):
|
async def hard(ctx):
|
||||||
await self.send_image(ctx, "images/hard.gif")
|
await self.send_image(ctx, "images/hard.gif")
|
||||||
|
|
||||||
|
@self.command()
|
||||||
|
async def inin(ctx):
|
||||||
|
await self.send_image(ctx, "images/in.png")
|
||||||
|
|
||||||
@self.command()
|
@self.command()
|
||||||
async def liked(ctx):
|
async def liked(ctx):
|
||||||
await self.send_image(ctx, "images/liked.png")
|
await self.send_image(ctx, "images/liked.png")
|
||||||
@@ -1286,6 +1316,10 @@ class Robottas(commands.Bot):
|
|||||||
async def ricky(ctx):
|
async def ricky(ctx):
|
||||||
await self.send_image(ctx, "images/ricky.gif")
|
await self.send_image(ctx, "images/ricky.gif")
|
||||||
|
|
||||||
|
@self.command()
|
||||||
|
async def rude(ctx):
|
||||||
|
await self.send_image(ctx, "images/rude.mp4")
|
||||||
|
|
||||||
@self.command()
|
@self.command()
|
||||||
async def stupid(ctx):
|
async def stupid(ctx):
|
||||||
await self.send_image(ctx, "images/stupid.png")
|
await self.send_image(ctx, "images/stupid.png")
|
||||||
|
|||||||
Reference in New Issue
Block a user