aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2020-01-06 00:18:30 -0500
committerRapptz <[email protected]>2020-01-06 00:30:04 -0500
commitf1118273f599ac72d9a6ec973ddecc747f166faf (patch)
tree76eab41ec8c87389c9eda3f949c8a44d1d860828
parent[commands] Make Command.can_run process disabled commands (diff)
downloaddiscord.py-f1118273f599ac72d9a6ec973ddecc747f166faf.tar.xz
discord.py-f1118273f599ac72d9a6ec973ddecc747f166faf.zip
Fix Member.mentioned_in returning True if in separate guilds
-rw-r--r--discord/member.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/discord/member.py b/discord/member.py
index 4d3d2749..e660187e 100644
--- a/discord/member.py
+++ b/discord/member.py
@@ -53,7 +53,7 @@ class VoiceState:
self_stream: :class:`bool`
Indicates if the user is currently streaming via 'Go Live' feature.
- .. versionadded:: 1.3.0
+ .. versionadded:: 1.3.0
self_video: :class:`bool`
Indicates if the user is currently broadcasting video.
@@ -389,12 +389,14 @@ class Member(discord.abc.Messageable, _BaseUser):
message: :class:`Message`
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):
return True
for role in message.role_mentions:
- has_role = utils.get(self.roles, id=role.id) is not None
- if has_role:
+ if self._roles.has(role.id):
return True
return False