Mecha-Karen/acord

A question

wynwxst opened this issue · 4 comments

Describe the bug
A clear and concise description of what the bug is.

Reproducible code

# Your code here

Here in examples/commander/commander.py
Full error message

Error raised
  File "C:\Users\blzza\Downloads\acord\examples\commander\commander.py", line 147, in <module>
    bot.run(token=...) # replace with test token
  File "C:\Users\blzza\Downloads\acord\examples\commander\acord\client\client.py", line 678, in run
    from acord.rest import RestApi
  File "C:\Users\blzza\Downloads\acord\examples\commander\acord\rest\__init__.py", line 1, in <module>
    from .rest import RestApi
  File "C:\Users\blzza\Downloads\acord\examples\commander\acord\rest\rest.py", line 77, in <module>
    class RestApi:
  File "C:\Users\blzza\Downloads\acord\examples\commander\acord\rest\rest.py", line 137, in RestApi
    loop: asyncio.AbstractEventLoop = asyncio.get_event_loop(),
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3312.0_x64__qbz5n2kfra8p0\lib\asyncio\events.py", line 642, in get_event_loop
    raise RuntimeError('There is no current event loop in thread %r.'
RuntimeError: There is no current event loop in thread 'MainThread'.

Expected behavior
A clear and concise description of what you expected to happen.

I expected the bot to run and slash cmds to work

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • Service: Desktop
  • OS: Windows
  • Python Version: Latest 10.x
  • Acord Version Latest
  • Any of notes: ...

Additional context
Add any other context about the problem here.
While I understand that this is NOT related to this repository I was curious if there was a solution for this

You can try setting a new event loop before importing acord 👍

Havent experienced this issue myself yet so cant really pinpoint the issue

never mind fixed it

You can try setting a new event loop before importing acord 👍

the issue was that it was getting the loop without actually starting the loop so yeah I just caught it in acord