Browse Source

Fix crashing with wonky TYPING_START events.

Fixes #1439
pull/1441/head
Rapptz 7 years ago
parent
commit
351bb1927a
  1. 2
      discord/state.py

2
discord/state.py

@ -819,7 +819,7 @@ class ConnectionState:
user_id = utils._get_as_snowflake(data, 'user_id')
if isinstance(channel, DMChannel):
member = channel.recipient
elif isinstance(channel, TextChannel):
elif isinstance(channel, TextChannel) and guild is not None:
member = guild.get_member(user_id)
elif isinstance(channel, GroupChannel):
member = utils.find(lambda x: x.id == user_id, channel.recipients)

Loading…
Cancel
Save