티스토리 뷰
728x90
import logging
from slack_sdk import WebClient
from slack_sdk.errors import SlackApiError
logger = logging.getLogger(__name__)
def chat(token, channel, text):
client = WebClient(token=token)
try:
client.chat_postMessage(channel=channel, text=text)
except SlackApiError as e:
logger.error(f"[Error] posting message: {e}")
return {
"channel": channel,
"text": text,
}
def files(token, channel, file):
client = WebClient(token=token)
try:
client.files_upload(
channels=channel,
initial_comment=None,
file=file,
)
except SlackApiError as e:
logger.error("[Error] uploading file: {}".format(e))
return {
"channel": channel,
"file": file,
}
https://yunwoong.tistory.com/132
https://developerdk.tistory.com/96
https://api.slack.com/methods/chat.postMessage/code
https://api.slack.com/methods/files.upload
728x90
'공부' 카테고리의 다른 글
[MySQL] INSERT ... ON DUPLICATE KEY UPDATE ... (0) | 2022.08.31 |
---|---|
[python] if some_string: (some_string is empty) (0) | 2022.08.31 |
[aws] s3 cp github action (workflow) (0) | 2022.08.31 |
[MySQL] id 컬럼 데이터타입 INT? BIGINT? (0) | 2022.08.31 |
[golang] env -> variable (0) | 2022.08.24 |
댓글
250x250
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- 연애학개론
- 테슬라 레퍼럴
- 테슬라 추천
- 김달
- 테슬라 레퍼럴 적용 확인
- Bot
- COUNT
- 테슬라 리퍼럴 코드
- 할인
- 테슬라 리퍼럴 코드 생성
- 테슬라
- 책그림
- Kluge
- wlw
- 테슬라 크레딧 사용
- 모델y
- 모델 Y 레퍼럴
- 메디파크 내과 전문의 의학박사 김영수
- 유투브
- 인스타그램
- 클루지
- 개리마커스
- follower
- 레퍼럴
- 팔로워 수 세기
- 테슬라 레퍼럴 코드 확인
- 테슬라 리퍼럴 코드 혜택
- 어떻게 능력을 보여줄 것인가?
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 |
글 보관함