Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignoring exception in on_ready #29

Open
AJenbo opened this issue Apr 28, 2024 · 3 comments
Open

Ignoring exception in on_ready #29

AJenbo opened this issue Apr 28, 2024 · 3 comments

Comments

@AJenbo
Copy link
Member

AJenbo commented Apr 28, 2024

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
Copy link
Member

qndel commented Apr 28, 2024

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

@AJenbo
Copy link
Member Author

AJenbo commented Apr 28, 2024

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
Copy link
Member

qndel commented Apr 28, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants