Took user restrictions off starting race reporting. Tried to improve sql writes to fix db locking error.

This commit is contained in:
tamservo
2025-04-21 16:47:05 -04:00
parent 069d2ca7d0
commit 4b636eed7a
2 changed files with 66 additions and 51 deletions

View File

@@ -904,56 +904,60 @@ class Robottas(commands.Bot):
self.driver_dict = {
'1': '<:VER:1067541523748630570>',
'3': '<:RIC:1067870312949108887>',
'5': '<:VET:1067964065516884079>',
'4': '<:NOR:1067840487593082941>',
'5': '<:BOR:1345026018938716161>',
'6': '<:HAD:1345027038104387674>',
'7': '<:DOO:1289936390993215601>',
'10': '<:GAS:1067836596495327283>',
'11': '<:PER:1067822335123525732>',
'12': '<:ANT:1289237308805222491>',
'14': '<:ALO:1067876094033793054>',
'16': '<:LEC:1067544797050585198>',
'18': '<:STR:1067871582854336663>',
'20': '<:MAG:1067883814992486510>',
'22': '<:TSU:1067888851676315660>',
'23': '<:ALB:1067874026871074887>',
'24': '<:ZHO:1067865955117568010>',
'27': '<:HUL:1067880110918742187>',
'30': '<:LAW:1289237140051464204>',
'31': '<:OCO:1067834157465612398>',
'43': '<:COL:1289237227049844849>',
'44': '<:HAM:1067828533746991165>',
'55': '<:SAI:1067824776502067270>',
'63': '<:RUS:1067831294748274728>',
'16': '<:LEC:1067544797050585198>',
'18': '<:STR:1067871582854336663>',
'4': '<:NOR:1067840487593082941>',
'10': '<:GAS:1067836596495327283>',
'27': '<:HUL:1067880110918742187>',
'31': '<:OCO:1067834157465612398>',
'77': '<:BOT:1067819716527276032>',
'81': '<:PIA:1067844998369914961>',
'24': '<:ZHO:1067865955117568010>',
'22': '<:TSU:1067888851676315660>',
'20': '<:MAG:1067883814992486510>',
'23': '<:ALB:1067874026871074887>',
'38': '<:BEA:1289237392649224278>',
'87': '<:BEA:1289237392649224278>'
}
# Holds dictionary for driver 3-letter code to icon
self.name_dict = {
'VER': '<:VER:1067541523748630570>',
'RIC': '<:RIC:1067870312949108887>',
'VET': '<:VET:1067964065516884079>',
'PER': '<:PER:1067822335123525732>',
'ALB': '<:ALB:1067874026871074887>',
'ALO': '<:ALO:1067876094033793054>',
'HAM': '<:HAM:1067828533746991165>',
'SAI': '<:SAI:1067824776502067270>',
'RUS': '<:RUS:1067831294748274728>',
'LEC': '<:LEC:1067544797050585198>',
'STR': '<:STR:1067871582854336663>',
'NOR': '<:NOR:1067840487593082941>',
'ANT': '<:ANT:1289237308805222491>',
'BEA': '<:BEA:1289237392649224278>',
'BOR': '<:BOR:1345026018938716161>',
'BOT': '<:BOT:1067819716527276032>',
'COL': '<:COL:1289237227049844849>',
'DOO': '<:DOO:1289936390993215601>',
'GAS': '<:GAS:1067836596495327283>',
'HAD': '<:HAD:1345027038104387674>',
'HAM': '<:HAM:1067828533746991165>',
'HUL': '<:HUL:1067880110918742187>',
'LAW': '<:LAW:1289237140051464204>',
'OCO': '<:OCO:1067834157465612398>',
'BOT': '<:BOT:1067819716527276032>',
'PIA': '<:PIA:1067844998369914961>',
'ZHO': '<:ZHO:1067865955117568010>',
'TSU': '<:TSU:1067888851676315660>',
'LEC': '<:LEC:1067544797050585198>',
'MAG': '<:MAG:1067883814992486510>',
'ALB': '<:ALB:1067874026871074887>',
'BEA': '<:BEA:1289237392649224278>',
'COL': '<:COL:1289237227049844849>',
'ANT': '<:ANT:1289237308805222491>'
'NOR': '<:NOR:1067840487593082941>',
'OCO': '<:OCO:1067834157465612398>',
'PIA': '<:PIA:1067844998369914961>',
'RIC': '<:RIC:1067870312949108887>',
'RUS': '<:RUS:1067831294748274728>',
'SAI': '<:SAI:1067824776502067270>',
'STR': '<:STR:1067871582854336663>',
'TSU': '<:TSU:1067888851676315660>',
'VER': '<:VER:1067541523748630570>',
'VET': '<:VET:1067964065516884079>',
'ZHO': '<:ZHO:1067865955117568010>'
}
# Holds dictionary for race states to icons
@@ -986,7 +990,7 @@ class Robottas(commands.Bot):
self.started = False
# Hold message delay
self.delay = 45
self.delay = 25
self.message_queue = []
# Hold whether to report deleted lap messages
@@ -1127,24 +1131,24 @@ class Robottas(commands.Bot):
@self.command()
async def race(ctx):
if ctx.author.id == 581960756271251457 or \
ctx.author.guild_permissions.administrator:
await ctx.send(":robot::peach: Ready to report for the race!")
await self._race_report(ctx)
#if ctx.author.id == 581960756271251457 or \
# ctx.author.guild_permissions.administrator:
await ctx.send(":robot::peach: Ready to report for the race!")
await self._race_report(ctx)
@self.command()
async def quali(ctx):
if ctx.author.id == 581960756271251457 or \
ctx.author.guild_permissions.administrator:
await ctx.send(":robot::peach: Ready to report on quali!")
await self._quali_report(ctx)
#if ctx.author.id == 581960756271251457 or \
# ctx.author.guild_permissions.administrator:
await ctx.send(":robot::peach: Ready to report on quali!")
await self._quali_report(ctx)
@self.command()
async def practice(ctx):
if ctx.author.id == 581960756271251457 or \
ctx.author.guild_permissions.administrator:
await ctx.send(":robot::peach: Ready to report on practice!")
await self._practice_report(ctx)
#if ctx.author.id == 581960756271251457 or \
# ctx.author.guild_permissions.administrator:
await ctx.send(":robot::peach: Ready to report on practice!")
await self._practice_report(ctx)
@self.command()
async def flap(ctx):