Added forecast and undercut.

This commit is contained in:
tamservo 2023-08-27 17:25:15 -04:00
parent b01511d052
commit 5834927d3e
1 changed files with 31 additions and 12 deletions

View File

@ -50,6 +50,14 @@ class Robottas(commands.Bot):
await self.channel.send(message)
async def send_image(self, ctx, image_file):
file_name = os.path.dirname(os.path.realpath(__file__))
file_name = os.path.join(file_name, image_file)
with open(file_name, "rb") as handle:
df = discord.File(handle, filename=file_name)
await ctx.send(file=df)
def send_delay_message(self, message):
self.message_queue.append((time.time(), message))
@ -601,7 +609,7 @@ class Robottas(commands.Bot):
'5': '<:VET:1067964065516884079>',
'11': '<:PER:1067822335123525732>',
'14': '<:ALO:1067876094033793054>',
'40': ':neutral_face:',
'40': ':kiwi:',
'44': '<:HAM:1067828533746991165>',
'55': '<:SAI:1067824776502067270>',
'63': '<:RUS:1067831294748274728>',
@ -635,7 +643,7 @@ class Robottas(commands.Bot):
'NOR': '<:NOR:1067840487593082941>',
'GAS': '<:GAS:1067836596495327283>',
'HUL': '<:HUL:1067880110918742187>',
'LAW': ':neutral_face:',
'LAW': ':kiwi:',
'OCO': '<:OCO:1067834157465612398>',
'BOT': '<:BOT:1067819716527276032>',
'PIA': '<:PIA:1067844998369914961>',
@ -714,7 +722,11 @@ class Robottas(commands.Bot):
"!podium - Display podium positions.\n" +
"!q1cut - Show drivers in Q1 cut positions.\n" +
"!q2cut - Show drivers in Q2 cut positions.\n" +
"!rbdelay - Set the race messaging delay in seconds."
"!rbdelay - Set the race messaging delay in seconds.\n" +
"The following display race control messages:\n" +
" !calm\n" +
" !forecast\n" +
" !undercut\n"
)
@self.command()
@ -828,15 +840,6 @@ class Robottas(commands.Bot):
await self.start_collect()
@self.command()
async def calm(ctx):
file_name = os.path.dirname(os.path.realpath(__file__))
file_name = os.path.join(file_name, "images/calm.png")
with open(file_name, "rb") as handle:
df = discord.File(handle, filename=file_name)
await ctx.send(file = df)
@self.command()
async def danger(ctx):
await ctx.send("That's some dangerous driving! " + self.name_dict["HAM"])
@ -944,6 +947,22 @@ class Robottas(commands.Bot):
await ctx.send("Bono, my tyres are gone " + self.name_dict["HAM"])
# Commands that send images
@self.command()
async def calm(ctx):
await self.send_image(ctx, "images/calm.png")
@self.command()
async def forecast(ctx):
await self.send_image(ctx, "images/forecast.png")
@self.command()
async def undercut(ctx):
await self.send_image(ctx, "images/undercut.png")
if __name__ == '__main__':
rb = Robottas()
rb.run_robottas()