Skip to content

Instantly share code, notes, and snippets.

@tfheen
Created October 21, 2015 15:55
Show Gist options
  • Save tfheen/9068930bdc3e4047dba4 to your computer and use it in GitHub Desktop.
Save tfheen/9068930bdc3e4047dba4 to your computer and use it in GitHub Desktop.
diff --git a/wee_slack.py b/wee_slack.py
index 59a1cd5..ab40934 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -465,13 +465,13 @@ class Channel(object):
message = message.split(' ')
for item in enumerate(message):
if item[1].startswith('@') and len(item[1]) > 1:
- named = re.match('.*[@#](\w+)(\W*)', item[1]).groups()
+ named = re.match('.*[@#]([\w.]+)(\W*)', item[1]).groups()
if named[0] in ["group", "channel", "here"]:
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[0], named[1])
if item[1].startswith('#') and self.server.channels.find(item[1]):
- named = re.match('.*[@#](\w+)(\W*)', item[1]).groups()
+ named = re.match('.*[@#]([\w.]+)(\W*)', item[1]).groups()
if self.server.channels.find(named[0]):
message[item[0]] = "<#{}|{}>{}".format(self.server.channels.find(named[0]).identifier, named[0], named[1])
dbg(message)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment