본문으로 바로가기

Slack Webhook 메세지 보내기

category selenium 2023. 3. 7. 02:37
728x90
import json, requests
import slack

def slackmessage():
        api_url="webhook_url"
        headers ={
            "Content-type": "application/json"
        }
        data=json.dumps({
            "attachments":[
                {
                    "title" : 제목,
                    "color":"#D00000",
                    "fields":[
                        {
                            "value":"코멘트 내용"
                        }

                    ]
                }
            ]
        })
        requests.post(api_url,headers=headers,data=data)