dolfies / discord.py-self

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

ClientEventTask exception was never retrieved #121

Closed Randy-Jack closed 2 years ago

Randy-Jack commented 2 years ago

Summary

Just after a few seconds of running my code this error comes which is there in "Actual Results" Section. The problem appears only on a few accounts of discord and not all

Reproduction Steps

None

Code

No response

Expected Results

Bot should just automate and send the messages we want from it but instead it is giving this error below

Actual Results

ClientEventTask exception was never retrieved
future: <ClientEventTask state=finished event=on_message coro=<bound method MyClient.on_message of <main.MyClient object at 0x7fdd00154bb0>> exception=SystemExit(None)>
Traceback (most recent call last):
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 621, in run
    loop.run_forever()
  File "/usr/lib/python3.8/asyncio/base_events.py", line 570, in run_forever
    self._run_once()
  File "/usr/lib/python3.8/asyncio/base_events.py", line 1859, in _run_once
    handle._run()
  File "/usr/lib/python3.8/asyncio/events.py", line 81, in _run
    self._context.run(self._callback, self._args)
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 301, in _run_event
    await coro(args, **kwargs)
  File "main.py", line 24, in on_message
    quit()
  File "/usr/lib/python3.8/_sitebuiltins.py", line 26, in call
    raise SystemExit(code)
SystemExit: None

System Information

Checklist

Additional Information

No response

pptx704 commented 2 years ago

You should've shared the code snippet inside on_message. The problem seems to be inside event=on_message.

dolfies commented 2 years ago

Yup, this is your code calling quit() in on_message.