diasurgical / devilutionx-gamelist

Small program for printing out a json list of current games
MIT License
1 stars 6 forks source link

Ignoring exception in on_ready #29

Open AJenbo opened 6 months ago

AJenbo commented 6 months ago

This error appears to stop the bot from running, wonder if it's solvable.

2024-04-28 11:55:47 ERROR    discord.client Ignoring exception in on_ready
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/discord/client.py", line 441, in _run_event
    await coro(*args, **kwargs)
  File "/home/ajenbo/test.py", line 269, in on_ready
    await background_task()
  File "/home/ajenbo/test.py", line 255, in background_task
    await client.change_presence(activity=activity)
  File "/usr/lib/python3/dist-packages/discord/client.py", line 2040, in change_presence
    await self.ws.change_presence(activity=activity, status=status_str)
  File "/usr/lib/python3/dist-packages/discord/gateway.py", line 701, in change_presence
    await self.send(sent)
  File "/usr/lib/python3/dist-packages/discord/gateway.py", line 655, in send
    await self.socket.send_str(data)
  File "/usr/lib/python3/dist-packages/aiohttp/client_ws.py", line 151, in send_str
    await self._writer.send(data, binary=False, compress=compress)
  File "/usr/lib/python3/dist-packages/aiohttp/http_websocket.py", line 690, in send
    await self._send_frame(message, WSMsgType.TEXT, compress)
  File "/usr/lib/python3/dist-packages/aiohttp/http_websocket.py", line 601, in _send_frame
    raise ConnectionResetError("Cannot write to closing transport")
ConnectionResetError: Cannot write to closing transport
qndel commented 6 months ago

Why not create a script checking if bot is running and restarting it if it's not? :)

AJenbo commented 6 months ago

sounds a bit metta, but also how would it do that. It's not like the script stopped running it just stopped making updates on discord.

qndel commented 6 months ago

make it write stuff to a file every minute and the script would consume that file, if no file exists when script wants to delete it = restart bot? :P