Browse Source

Explicitly check for guild object

pull/2538/head
Merlintor 5 years ago
parent
commit
1451f790a0
  1. 3
      discord/message.py

3
discord/message.py

@ -41,6 +41,7 @@ from .member import Member
from .flags import MessageFlags from .flags import MessageFlags
from .file import File from .file import File
from .utils import escape_mentions from .utils import escape_mentions
from .guild import Guild
class Attachment: class Attachment:
@ -441,7 +442,7 @@ class Message:
def _handle_author(self, author): def _handle_author(self, author):
self.author = self._state.store_user(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) found = self.guild.get_member(self.author.id)
if found is not None: if found is not None:
self.author = found self.author = found

Loading…
Cancel
Save