aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcalve <calvinh34@gmail.com>2015-10-28 11:49:54 +0100
committercalve <calvinh34@gmail.com>2016-01-04 11:11:19 +0100
commit2592aaf3322ba8af93e36a52602d75ea55e6ce79 (patch)
tree0b5d8ee8f198bac1ad4f96169fec7fec5b64b503
parentc9f9533200fbb8a7e7bc9a9f21f8db175a8d019c (diff)
downloadwee-slack-2592aaf3322ba8af93e36a52602d75ea55e6ce79.tar.gz
Match references to channels
-rw-r--r--wee_slack.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/wee_slack.py b/wee_slack.py
index 63b7a13..e9733ef 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -1674,8 +1674,8 @@ def unfurl_refs(text, ignore_alt_text=False):
input : <@U096Q7CQM|someuser> has joined the channel
ouput : someuser has joined the channel
"""
- # Find all string enclosed by <> and starting with an @
- matches = re.findall(r"(<@(?:\S*)>)", text)
+ # Find all string enclosed by <> and starting with an ``@`` on a ``#``
+ matches = re.findall(r"(<[@#](?:\S*)>)", text)
for m in matches:
# Replace them with human readable strings
text = text.replace(m, unfurl_ref(m[1:-1], ignore_alt_text))