updated requirements.txt and bugfixes in robottas.py

This commit is contained in:
tamservo 2023-07-30 20:15:37 -04:00
parent 66eee52bb5
commit c4955c4298
2 changed files with 8 additions and 8 deletions

2
requirements.txt Normal file → Executable file
View File

@ -1,3 +1,5 @@
beautifulsoup4==4.9.3
discord.py==2.2.3
fastf1==3.0.3
jdata==0.5.3
Requests==2.31.0

View File

@ -854,7 +854,7 @@ class Robottas(commands.Bot):
@self.command()
async def danger(ctx):
await ctx.send("That's some dangerous driving! " + name_dict["HAM"]
await ctx.send("That's some dangerous driving! " + name_dict["HAM"])
@self.command()
@ -864,7 +864,7 @@ class Robottas(commands.Bot):
@self.command()
async def flip(ctx):
await ctx.send( random.choice(["Heads","Tails")
await ctx.send( random.choice(["Heads","Tails"]))
@self.command()
@ -877,10 +877,8 @@ class Robottas(commands.Bot):
try:
con = sqlite3.connect('races.db')
cur = con.cursor()
for row in cur.execute("select * from quotes " +
"order by random() " +
"limit 1")
for row in cur.execute('select * from quotes order by Random() limit 1'):
message = row[0] + " -- " + row[1] + " " + row[2]
await ctx.send(message)
break # There should only be one row anyway
@ -922,7 +920,7 @@ class Robottas(commands.Bot):
cur = con.cursor()
for row in cur.execute('select * from races ' +
'order by Random() ' +
'limit 1')
'limit 1'):
watched = self.decode_watched(row[2])
await ctx.send(f"Location: {row[0]} Year: {row[1]} {watched}")
@ -943,7 +941,7 @@ class Robottas(commands.Bot):
for row in cur.execute('select * from races ' +
'where watched = 0 ' +
'order by Random() ' +
'limit 1')
'limit 1'):
watched = self.decode_watched(row[2])
await ctx.send(f"Location: {row[0]} Year: {row[1]}")