Browse Source

Support 'User (mention)' style mentions used by recent client updates (#171)

* Support 'User (mention)' style mentions.

* Remove conditional that should no longer be needed.

(from PR feedback)
pull/152/head
slicedlime (Mikael Hedberg) 5 years ago
committed by “elderlabs”
parent
commit
f1653b929d
  1. 3
      disco/bot/bot.py

3
disco/bot/bot.py

@ -313,8 +313,9 @@ class Bot(LoggingClass):
if msg.guild: if msg.guild:
member = msg.guild.get_member(self.client.state.me) member = msg.guild.get_member(self.client.state.me)
if member: if member:
content = content.replace(member.user.mention_nickname, '', 1) # Filter both the normal and nick mentions
content = content.replace(member.user.mention, '', 1) content = content.replace(member.user.mention, '', 1)
content = content.replace(member.user.mention_nickname, '', 1)
else: else:
content = content.replace(self.client.state.me.mention, '', 1) content = content.replace(self.client.state.me.mention, '', 1)
elif mention_everyone: elif mention_everyone:

Loading…
Cancel
Save