aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMerlintor <[email protected]>2020-01-26 14:43:10 +0100
committerMerlintor <[email protected]>2020-01-26 14:43:10 +0100
commit1451f790a01bf9b42c9e364d75cff4560f988a76 (patch)
tree4f4bfddcfaaca23d5c2cdb07dd6817fdebe44a1f
parentDocument the new opus loading behaviour (diff)
downloaddiscord.py-1451f790a01bf9b42c9e364d75cff4560f988a76.tar.xz
discord.py-1451f790a01bf9b42c9e364d75cff4560f988a76.zip
Explicitly check for guild object
-rw-r--r--discord/message.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/discord/message.py b/discord/message.py
index 62585735..fb5f5d04 100644
--- a/discord/message.py
+++ b/discord/message.py
@@ -41,6 +41,7 @@ from .member import Member
from .flags import MessageFlags
from .file import File
from .utils import escape_mentions
+from .guild import Guild
class Attachment:
@@ -441,7 +442,7 @@ class Message:
def _handle_author(self, author):
self.author = self._state.store_user(author)
- if self.guild is not None:
+ if isinstance(self.guild, Guild):
found = self.guild.get_member(self.author.id)
if found is not None:
self.author = found