Fixed parse_role of role mention.
authorCMDR furrycat <elite@furrycat.net>
Mon, 12 Feb 2018 10:11:24 +0000 (10:11 +0000)
committerCMDR furrycat <elite@furrycat.net>
Mon, 12 Feb 2018 10:11:24 +0000 (10:11 +0000)
bot.py

diff --git a/bot.py b/bot.py
index 4a0b368..502fe65 100644 (file)
--- a/bot.py
+++ b/bot.py
@@ -373,7 +373,8 @@ async def parse_user(text, *, author = None):
   return user
 
 async def parse_role(text, *, author = None, server = None):
-  text = re.sub(r'^[@&]*', '@&', text)
+  if not re.match(r'^[@&<]', text):
+    text = '@&' + text
   parsed = parse_mention(text, author = author)
   if parsed is None:
     return None