slack.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:boss 作者: kabirbaidhya 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号