Skip to content

Commit

Permalink
Slack channels prefixed with a plus (+) symbol are interpreted as enc…
Browse files Browse the repository at this point in the history
…oded identifiers (vs #channel_name); refs #18
  • Loading branch information
caronc committed Jun 6, 2017
1 parent d021f29 commit bb88465
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Notify/pnotify/NotifySlack.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,16 @@ def _notify(self, title, body, notify_type, **kwargs):
)
continue

if len(channel) > 1 and channel[0] == '+':
# Treat as encoded id if prefixed with a +
_channel = channel[1:]
else:
# Prefix with channel hash tag
_channel = '#%s' % channel

# prepare JSON Object
payload = {
'channel': '#%s' % channel,
'channel': _channel,
'username': self.user,
# Use Markdown language
'mrkdwn': True,
Expand Down

0 comments on commit bb88465

Please sign in to comment.