diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2019-04-09 16:29:48 +0200 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2019-05-05 21:07:45 +0200 |
commit | fb0a7e01f0b2dd372de2575c21fb4ba705dfe834 (patch) | |
tree | 18c8a54714554fa63611071018efb14f1458c9c0 /wee_slack.py | |
parent | 49d481c7d903d72ebd7bcd0481fcab1acdcd2b71 (diff) | |
download | wee-slack-fb0a7e01f0b2dd372de2575c21fb4ba705dfe834.tar.gz |
Support subteams in resolve_ref
Diffstat (limited to 'wee_slack.py')
-rw-r--r-- | wee_slack.py | 5 |
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 |