Browse Source

Message.clean_content now takes into consideration @here mentions.

pull/130/merge
Rapptz 9 years ago
parent
commit
54e9be7aed
  1. 12
      discord/message.py

12
discord/message.py

@ -198,7 +198,17 @@ class Message:
pattern = re.compile('|'.join(transformations.keys()))
result = pattern.sub(repl, self.content)
return result.replace('@everyone', '@\u200beveryone')
transformations = {
'@everyone': '@\u200beveryone',
'@here': '@\u200bhere'
}
def repl2(obj):
return transformations.get(obj.group(0), '')
pattern = re.compile('|'.join(transformations.keys()))
return pattern.sub(repl2, result)
def _handle_upgrades(self, channel_id):
self.server = None

Loading…
Cancel
Save