git://git.furryclan.net
/
furrycat
/
catbot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b75ada5
)
Fixed parse_role of role mention.
author
CMDR furrycat
<elite@furrycat.net>
Mon, 12 Feb 2018 10:11:24 +0000
(10:11 +0000)
committer
CMDR furrycat
<elite@furrycat.net>
Mon, 12 Feb 2018 10:11:24 +0000
(10:11 +0000)
bot.py
patch
|
blob
|
history
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