aboutsummaryrefslogtreecommitdiffstats
path: root/wee_slack.py
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2019-04-09 16:29:48 +0200
committerTrygve Aaberge <trygveaa@gmail.com>2019-05-05 21:07:45 +0200
commitfb0a7e01f0b2dd372de2575c21fb4ba705dfe834 (patch)
tree18c8a54714554fa63611071018efb14f1458c9c0 /wee_slack.py
parent49d481c7d903d72ebd7bcd0481fcab1acdcd2b71 (diff)
downloadwee-slack-fb0a7e01f0b2dd372de2575c21fb4ba705dfe834.tar.gz
Support subteams in resolve_ref
Diffstat (limited to 'wee_slack.py')
-rw-r--r--wee_slack.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/wee_slack.py b/wee_slack.py
index 1b48348..631e24b 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -3275,6 +3275,11 @@ def resolve_ref(ref):
channel = team.channels.get(ref[1:])
if channel:
return channel.name
+ elif ref.startswith('!subteam'):
+ _, subteam_id = ref.split('^')
+ subteam = team.subteams.get(subteam_id)
+ if subteam:
+ return '@{}'.format(subteam.handle)
# Something else, just return as-is
return ref