mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
Allow sending direct messages with slack module
This commit is contained in:
@@ -141,7 +141,10 @@ def build_payload_for_slack(module, text, channel, username, icon_url, icon_emoj
|
|||||||
else:
|
else:
|
||||||
payload = dict(attachments=[dict(text=text, color=color)])
|
payload = dict(attachments=[dict(text=text, color=color)])
|
||||||
if channel is not None:
|
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:
|
if username is not None:
|
||||||
payload['username'] = username
|
payload['username'] = username
|
||||||
if icon_emoji is not None:
|
if icon_emoji is not None:
|
||||||
|
|||||||
Reference in New Issue
Block a user