728x90
Slack bot을 이용한 첨부파일을 포함한 메세지 보내기
* 참고 : https://api.slack.com/tutorials/uploading-files-with-python
1. slack bot 생성
- Scope permission에 files:write 권한이 꼭 필요
2. 함수 작성
import ssl
import certifi
def attachfile_withSlack():
ssl_context = ssl.create_default_context(cafile=certifi.where())
client = slack.WebClient(token='토큰값', ssl=ssl_context)
response = client.files_upload(
channels="채널명",
title="제목",
file="파일위치",
initial_comment="코멘트내용"
)
아래 에러 발생 시
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate
설치 필요
pip install certifi
'selenium' 카테고리의 다른 글
Slack Webhook 메세지 보내기 (0) | 2023.03.07 |
---|---|
자동화 시 오류종류 (0) | 2023.01.30 |
Web 페이지 속도 (성능) (0) | 2022.10.14 |
[ERROR] stale element reference: element is not attached to the page document (0) | 2021.11.03 |
[Selenium] CSV 파일 key, value 값으로 읽기 (0) | 2020.05.15 |