aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Tiwald <ctiwald@conductor.com>2015-03-11 20:29:49 -0400
committerChristopher Tiwald <ctiwald@conductor.com>2015-03-11 20:32:32 -0400
commit8fd5e68737b716dfbb609619c381fe3363f45c12 (patch)
tree1aa0aa66c9639d7d4bb24929b280ab2b238135da
parent6b7ba0383800862e6f7e3672ab791971b8f2038a (diff)
downloadwee-slack-8fd5e68737b716dfbb609619c381fe3363f45c12.tar.gz
linkify_text: Add support for "@group" and "@channel".
These two commands are aliases for one another, and should work in both private and public channels in Slack. Technically, there's also an !everyone command, but that isn't implemented here.
-rw-r--r--wee_slack.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/wee_slack.py b/wee_slack.py
index 6189220..5b089d1 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -456,6 +456,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]):