def send(notif_type, **params):
''' Send slack notifications. '''
url = config()['base_url'] + config()['endpoint']
(text, color) = notification.get(
notif_type,
config=get_config(),
notif_config=config(),
create_link=create_link,
**params
)
payload = {
'attachments': [
{
'color': color,
'text': text
}
]
}
requests.post(url, json=payload)
评论列表
文章目录