dolfies / discord.py-self

A fork of the popular discord.py for user accounts.
https://discordpy-self.rtfd.io/en/latest/
MIT License
651 stars 154 forks source link

Bot errors out and disconnects after sending messages #611

Closed piotr25691 closed 7 months ago

piotr25691 commented 7 months ago

Summary

The bot errors out and disconnects after sending messages.

Reproduction Steps

  1. Got latest version of the library from Git
  2. Sent some messages
  3. Bot cut out

Code

No response

Expected Results

Should’ve not disconnected

Actual Results

Errors are happening:

Exception in callback Task.task_wakeup(<Future finished result=None>)
8|clyde  | handle: <Handle Task.task_wakeup(<Future finished result=None>)>
8|clyde  | Traceback (most recent call last):
8|clyde  |   File "/usr/lib/python3.11/asyncio/events.py", line 80, in _run
8|clyde  |     self._context.run(self._callback, *self._args)
8|clyde  | RuntimeError: Cannot enter into task <Task pending name='Task-1' coro=<Client.run.<locals>.runner() running at /root/runner/public/clyde/clyde-venv/lib/python3.11/site-packages/discord/client.py:1048> wait_for=<Future finished result=None> cb=[_run_until_complete_cb() at /usr/lib/python3.11/asyncio/base_events.py:180]> while another task <Task pending name='discord.py: on_message' coro=<Client._run_event() running at /root/runner/public/clyde/clyde-venv/lib/python3.11/site-packages/discord/client.py:600>> is being executed.
8|clyde  | [2023-11-20 19:36:33] [WARNING ] discord.gateway: Gateway has stopped responding. Closing and restarting.

System Information

Checklist

Additional Information

No response

piotr25691 commented 7 months ago

Mind I tell you, I was querying ChatGPT with the bot, was the library blocking the bot causing it to disconnect?

piotr25691 commented 7 months ago

Alright fixed it, discovered that async tasks were blocking each other