Browse Source

Fix crashing when an unhandled event occurs.

pull/124/head
Rapptz 9 years ago
parent
commit
6694df268c
  1. 8
      discord/client.py

8
discord/client.py

@ -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…
Cancel
Save