Implement better send message function for Slack messages
Implement better function to send slack messages useful as a starting point for higher level reporting functions.
API:
class SlackMessage:
def __init__(self, template, arguments=None, image=None, attachment=None):
"""Create Slack message.
Args:
template: Jinja template.
template_args (dict): Arguments to be passed to the Jinja templates .
attachment (Path): Path to file (or image) to attach to the image.
"""
# ...
def send_slack_message(channel, msg, thread=None, thread=None):
"""Send Slack message.
Args:
channel: Target Slack channel.
msg (SlackMessage): Arguments to be passed to the Jinja templates .
"""
# ...
# Ex
msg = SlackMessage(msg_tpl, tpl_args, some_attachment)
send_slack_message_to_channel(channel, msg)
Parent issue #148 (closed)
Edited by Pablo Andres Lorenzatto