diff options
author | Ryan Huber <rhuber@gmail.com> | 2015-04-06 09:33:04 -0700 |
---|---|---|
committer | Ryan Huber <rhuber@gmail.com> | 2015-04-06 09:33:04 -0700 |
commit | f0f42005641bee5cd315ba4ac7b2747d01bdee60 (patch) | |
tree | 0245f0cd888251f8131f0455aa754b7162c129fd | |
parent | a84a29dad82d66c5148c8296cb86ae42e129c43d (diff) | |
parent | 8fd5e68737b716dfbb609619c381fe3363f45c12 (diff) | |
download | wee-slack-f0f42005641bee5cd315ba4ac7b2747d01bdee60.tar.gz |
Merge pull request #50 from ctiwald/master
linkify_text: Add support for "@group" and "@channel".
-rw-r--r-- | wee_slack.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/wee_slack.py b/wee_slack.py index 05e016d..bd8292a 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -458,6 +458,8 @@ class Channel(SlackThing): for item in enumerate(message): if item[1].startswith('@'): named = re.match('.*[@#](\w+)(\W*)', item[1]).groups() + if named[0] in ["group", "channel"]: + message[item[0]] = "<!{}>".format(named[0]) if self.server.users.find(named[0]): message[item[0]] = "<@{}>{}".format(self.server.users.find(named[0]).identifier, named[1]) if item[1].startswith('#') and self.server.channels.find(item[1]): |