mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-20 07:54:36 +00:00
Fix crashing when an unhandled event occurs.
This commit is contained in:
parent
80587fc1e9
commit
6694df268c
@ -370,10 +370,10 @@ class Client:
|
||||
func = getattr(self.connection, parser)
|
||||
except AttributeError:
|
||||
log.info('Unhandled event {}'.format(event))
|
||||
|
||||
result = func(data)
|
||||
if asyncio.iscoroutine(result):
|
||||
utils.create_task(result, loop=self.loop)
|
||||
else:
|
||||
result = func(data)
|
||||
if asyncio.iscoroutine(result):
|
||||
utils.create_task(result, loop=self.loop)
|
||||
|
||||
@asyncio.coroutine
|
||||
def _make_websocket(self, initial=True):
|
||||
|
Loading…
x
Reference in New Issue
Block a user