Fix Member.mentioned_in returning True if in separate guilds

This commit is contained in:
Rapptz 2020-01-06 00:18:30 -05:00
parent 527b3485dc
commit f1118273f5

View File

@ -53,7 +53,7 @@ class VoiceState:
self_stream: :class:`bool` self_stream: :class:`bool`
Indicates if the user is currently streaming via 'Go Live' feature. Indicates if the user is currently streaming via 'Go Live' feature.
.. versionadded:: 1.3.0 .. versionadded:: 1.3.0
self_video: :class:`bool` self_video: :class:`bool`
Indicates if the user is currently broadcasting video. Indicates if the user is currently broadcasting video.
@ -389,12 +389,14 @@ class Member(discord.abc.Messageable, _BaseUser):
message: :class:`Message` message: :class:`Message`
The message to check if you're mentioned in. The message to check if you're mentioned in.
""" """
if message.guild is None or message.guild.id != self.guild.id:
return False
if self._user.mentioned_in(message): if self._user.mentioned_in(message):
return True return True
for role in message.role_mentions: for role in message.role_mentions:
has_role = utils.get(self.roles, id=role.id) is not None if self._roles.has(role.id):
if has_role:
return True return True
return False return False