aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--discord/state.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/discord/state.py b/discord/state.py
index df364296..22978e93 100644
--- a/discord/state.py
+++ b/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)