Closed Starwort closed 5 years ago
N.B. I don't think the problem is discord.py because it does comply with the provided loop policy.
Second note: printing type(loop)
gets <class 'asyncio.unix_events._UnixSelectorEventLoop'>
When manually creating an event loop, you need to do this:
asyncio.set_event_loop_policy(EventLoopPolicy())
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop) # <--
bot = Bot(loop=loop)
Or a shortcut:
asyncio.set_event_loop_policy(EventLoopPolicy())
loop = asyncio.get_event_loop() # get, instead of new. initializes a new loop the first time
bot = Bot(loop=loop)
Oh. Thanks, lol. I didn't know that. I'll try that now.
Update: Works perfectly! Thanks!
Bot initialised with
Error:
Sysinfo: Ubuntu 18.04.1 LTS, Stockfish 8 64 at
/usr/games/stockfish
, python-chess 0.27.3, Python 3.6.7, GCC 8.2.0 Relevant code provided (probably). Can submit more if needed.