Skip to content

Implementation Snippets

Thomas Howe edited this page Mar 24, 2023 · 3 revisions

Sending a vCon to a slack channel.

import requests import datetime def publish_to_slack(url, summary, link, call_at, duration): start = datetime.datetime.fromisoformat(call_at) slack_messsage = { "text": summary, "blocks": [ { "type": "section", "text": { "type": "mrkdwn", "text": f"*{start.strftime('%b %d %Y %H:%M:%S')}*: {duration} seconds. <{link}|Details>" } }, { "type": "section", "text": { "type": "mrkdwn", "text": summary } } ] } response = requests.post(url, json=slack_messsage)

Clone this wiki locally