From b1629ac77aae85bac95b7b315e82010c6da67bb3 Mon Sep 17 00:00:00 2001 From: Will Date: Thu, 22 Jan 2015 09:05:32 -0500 Subject: [PATCH] Allow sending direct messages with slack module --- notification/slack.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/notification/slack.py b/notification/slack.py index 5577228978b..b0dc9489182 100644 --- a/notification/slack.py +++ b/notification/slack.py @@ -111,7 +111,10 @@ def build_payload_for_slack(module, text, channel, username, icon_url, icon_emoj payload = dict(text=text) if channel is not None: - payload['channel'] = channel if (channel[0] == '#') else '#'+channel + if (channel[0] == '#') or (channel[0] == '@') + payload['channel'] = channel + else + payload['channel'] = '#'+channel if username is not None: payload['username'] = username if icon_emoji is not None: