mirror of
https://git.sdf.org/tamservo/robottas.git
synced 2025-11-12 17:13:49 -05:00
Added set_total_laps for when they change the number in the laps in the race (i.e. false start procedure.) Also fixed check for race half distance.
This commit is contained in:
37
robottas.py
37
robottas.py
@@ -179,9 +179,10 @@ class Robottas(commands.Bot):
|
|||||||
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
|
#Check to see about sending half distance message
|
||||||
if self.current_lap > int(self.total_laps / 2):
|
if self.current_lap > int(self.total_laps / 2):
|
||||||
await self.send_message("We've passed half distance! Has Lance binned it yet?")
|
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():
|
||||||
@@ -905,7 +906,7 @@ class Robottas(commands.Bot):
|
|||||||
'11': '<:PER:1067822335123525732>',
|
'11': '<:PER:1067822335123525732>',
|
||||||
'12': '<:ANT:1289237308805222491>',
|
'12': '<:ANT:1289237308805222491>',
|
||||||
'14': '<:ALO:1067876094033793054>',
|
'14': '<:ALO:1067876094033793054>',
|
||||||
'40': '<:LAW:1289237140051464204>',
|
'30': '<:LAW:1289237140051464204>',
|
||||||
'43': '<:COL:1289237227049844849>',
|
'43': '<:COL:1289237227049844849>',
|
||||||
'44': '<:HAM:1067828533746991165>',
|
'44': '<:HAM:1067828533746991165>',
|
||||||
'55': '<:SAI:1067824776502067270>',
|
'55': '<:SAI:1067824776502067270>',
|
||||||
@@ -1039,18 +1040,22 @@ class Robottas(commands.Bot):
|
|||||||
" !hard\n" +
|
" !hard\n" +
|
||||||
" !inin - in in in in in\n" +
|
" !inin - in in in in in\n" +
|
||||||
" !liked\n" +
|
" !liked\n" +
|
||||||
|
" !mariachi\n" +
|
||||||
" !no\n" +
|
" !no\n" +
|
||||||
" !noengine\n" +
|
" !noengine\n" +
|
||||||
" !pants\n" +
|
" !pants\n" +
|
||||||
" !paddock\n" +
|
" !paddock\n" +
|
||||||
" !penalty\n" +
|
" !penalty\n" +
|
||||||
|
" !rain\n" +
|
||||||
" !ricky\n" +
|
" !ricky\n" +
|
||||||
" !rude - Charles thinks it's rude.\n" +
|
" !rude - Charles thinks it's rude.\n" +
|
||||||
" !slight - Charles did a slight touch.\n" +
|
" !slight - Charles did a slight touch.\n" +
|
||||||
" !stupid\n" +
|
" !stupid\n" +
|
||||||
" !steer\n" +
|
" !steer\n" +
|
||||||
|
" !tm\n" +
|
||||||
" !undercut\n" +
|
" !undercut\n" +
|
||||||
" !wall - Lance is in the wall")
|
" !wall - Lance is in the wall\n" +
|
||||||
|
" !yuki")
|
||||||
|
|
||||||
await ctx.send("bot commands:\n" +
|
await ctx.send("bot commands:\n" +
|
||||||
" !register_next_race_alerts - get an alert for the next race on Monday.\n" +
|
" !register_next_race_alerts - get an alert for the next race on Monday.\n" +
|
||||||
@@ -1300,6 +1305,10 @@ class Robottas(commands.Bot):
|
|||||||
async def liked(ctx):
|
async def liked(ctx):
|
||||||
await self.send_image(ctx, "images/liked.png")
|
await self.send_image(ctx, "images/liked.png")
|
||||||
|
|
||||||
|
@self.command()
|
||||||
|
async def mariachi(ctx):
|
||||||
|
await self.send_image(ctx, "images/mariachi.mp4")
|
||||||
|
|
||||||
@self.command()
|
@self.command()
|
||||||
async def no(ctx):
|
async def no(ctx):
|
||||||
await self.send_image(ctx, "images/no.png")
|
await self.send_image(ctx, "images/no.png")
|
||||||
@@ -1321,6 +1330,10 @@ class Robottas(commands.Bot):
|
|||||||
async def penalty(ctx):
|
async def penalty(ctx):
|
||||||
await self.send_image(ctx, "images/penalty.png")
|
await self.send_image(ctx, "images/penalty.png")
|
||||||
|
|
||||||
|
@self.command()
|
||||||
|
async def rain(ctx):
|
||||||
|
await self.send_image(ctx, "images/rain.gif")
|
||||||
|
|
||||||
@self.command()
|
@self.command()
|
||||||
async def ricky(ctx):
|
async def ricky(ctx):
|
||||||
await self.send_image(ctx, "images/ricky.gif")
|
await self.send_image(ctx, "images/ricky.gif")
|
||||||
@@ -1341,6 +1354,10 @@ class Robottas(commands.Bot):
|
|||||||
async def steer(ctx):
|
async def steer(ctx):
|
||||||
await self.send_image(ctx, "images/steer.png")
|
await self.send_image(ctx, "images/steer.png")
|
||||||
|
|
||||||
|
@self.command()
|
||||||
|
async def tm(ctx):
|
||||||
|
await self.send_image(ctx, "images/tm.png")
|
||||||
|
|
||||||
@self.command()
|
@self.command()
|
||||||
async def undercut(ctx):
|
async def undercut(ctx):
|
||||||
await self.send_image(ctx, "images/undercut.png")
|
await self.send_image(ctx, "images/undercut.png")
|
||||||
@@ -1360,6 +1377,10 @@ class Robottas(commands.Bot):
|
|||||||
async def wall(ctx):
|
async def wall(ctx):
|
||||||
await self.send_image(ctx, "images/wall.mp4")
|
await self.send_image(ctx, "images/wall.mp4")
|
||||||
|
|
||||||
|
@self.command()
|
||||||
|
async def yuki(ctx):
|
||||||
|
await self.send_image(ctx, "images/yuki.mp4")
|
||||||
|
|
||||||
## Calendar Commands
|
## Calendar Commands
|
||||||
|
|
||||||
# Give days, hours, minutes until the next event
|
# Give days, hours, minutes until the next event
|
||||||
@@ -1387,6 +1408,12 @@ class Robottas(commands.Bot):
|
|||||||
async def register_next_event_alerts(ctx):
|
async def register_next_event_alerts(ctx):
|
||||||
await self.register_next_event_alerts(ctx)
|
await self.register_next_event_alerts(ctx)
|
||||||
|
|
||||||
|
# Set total laps ( like when they shorten the race laps )
|
||||||
|
@self.command()
|
||||||
|
async def set_total_laps(ctx, laps):
|
||||||
|
self.total_laps = laps
|
||||||
|
await ctx.send(f"Total laps set to {self.total_laps}")
|
||||||
|
|
||||||
# Unregister to get monday alerts
|
# Unregister to get monday alerts
|
||||||
@self.command()
|
@self.command()
|
||||||
async def unregister_alerts(ctx):
|
async def unregister_alerts(ctx):
|
||||||
|
|||||||
Reference in New Issue
Block a user