mirror of
https://git.sdf.org/tamservo/robottas.git
synced 2025-11-08 07:03:47 -05:00
added \!in
This commit is contained in:
34
robottas.py
34
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")
|
||||
|
||||
Reference in New Issue
Block a user