diff options
| author | Rapptz <[email protected]> | 2016-06-27 21:44:29 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2016-06-27 21:44:29 -0400 |
| commit | 01a46f0612d31bae5f142f39c92975dd7d3d6eb7 (patch) | |
| tree | 3066f5fce9a039828aacdf964cdfa627ef100aaf /discord/message.py | |
| parent | Ignore HEARTBEAT_ACK for now to disable the noisy logging. (diff) | |
| download | discord.py-01a46f0612d31bae5f142f39c92975dd7d3d6eb7.tar.xz discord.py-01a46f0612d31bae5f142f39c92975dd7d3d6eb7.zip | |
Make Message.channel_mentions unique.
Diffstat (limited to 'discord/message.py')
| -rw-r--r-- | discord/message.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/discord/message.py b/discord/message.py index 93d33f8a..365d1148 100644 --- a/discord/message.py +++ b/discord/message.py @@ -146,10 +146,8 @@ class Message: self.mentions.append(member) if self.server is not None: - for mention in self.raw_channel_mentions: - channel = self.server.get_channel(mention) - if channel is not None: - self.channel_mentions.append(channel) + it = filter(None, map(lambda m: self.server.get_channel(m), self.raw_channel_mentions)) + self.channel_mentions = utils._unique(it) for role_id in role_mentions: role = utils.get(self.server.roles, id=role_id) |