From af6a5efa538763eb2503b54742d8f6b10a60c79f Mon Sep 17 00:00:00 2001 From: Rapptz Date: Sun, 16 Feb 2020 21:45:27 -0500 Subject: [PATCH] Fix crashes when Message.guild is Object --- discord/message.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/discord/message.py b/discord/message.py index fb5f5d041..e1b88f121 100644 --- a/discord/message.py +++ b/discord/message.py @@ -468,7 +468,7 @@ class Message: self.mentions = r = [] guild = self.guild state = self._state - if guild is None: + if not isinstance(guild, Guild): self.mentions = [state.store_user(m) for m in mentions] return @@ -482,7 +482,7 @@ class Message: def _handle_mention_roles(self, role_mentions): self.role_mentions = [] - if self.guild is not None: + if isinstance(self.guild, Guild): for role_id in map(int, role_mentions): role = self.guild.get_role(role_id) if role is not None: