Nvm that sucks, probably try catch works as well.
This commit is contained in:
9
main.py
9
main.py
@@ -44,6 +44,7 @@ async def on_ready():
|
|||||||
|
|
||||||
@tasks.loop(seconds=5)
|
@tasks.loop(seconds=5)
|
||||||
async def task_loop():
|
async def task_loop():
|
||||||
|
try:
|
||||||
print(str(datetime.datetime.now()) + ": Loop running.")
|
print(str(datetime.datetime.now()) + ": Loop running.")
|
||||||
await bot.change_presence(
|
await bot.change_presence(
|
||||||
activity=discord.Activity(
|
activity=discord.Activity(
|
||||||
@@ -89,7 +90,11 @@ async def task_loop():
|
|||||||
)
|
)
|
||||||
if value == "Eliminated":
|
if value == "Eliminated":
|
||||||
await channel.send(
|
await channel.send(
|
||||||
'Game **"' + game.name + '"**: ' + key + " has been eliminated."
|
'Game **"'
|
||||||
|
+ game.name
|
||||||
|
+ '"**: '
|
||||||
|
+ key
|
||||||
|
+ " has been eliminated."
|
||||||
)
|
)
|
||||||
if value == "Turn unfinished":
|
if value == "Turn unfinished":
|
||||||
await channel.send(
|
await channel.send(
|
||||||
@@ -101,3 +106,5 @@ async def task_loop():
|
|||||||
)
|
)
|
||||||
game.update_players()
|
game.update_players()
|
||||||
game.to_json()
|
game.to_json()
|
||||||
|
except Exception as e:
|
||||||
|
print(e)
|
||||||
|
|||||||
Reference in New Issue
Block a user