티스토리 뷰
728x90
from slacker import Slacker
from PIL import Image
import requests
import os
image = "{url}"
slack = Slacker(token)
file = Image.open(requests.get(image, stream=True).raw)
filename = DateUtils.timestamp() + '.png'
file.save(filename)
slack.files.upload(filename, channels='#' + channel)
os.remove(filename)
[Python] Send Slack Massages and upload file
Token : https://api.slack.com/custom-integrations/legacy-tokens Legacy tokens Learn how to build bot users, send notifications, and interact with workspaces using our APIs. api.slack.com Slack에 채..
pydole.tistory.com
728x90
'공부' 카테고리의 다른 글
[Slack] slacker.Error: missing_scope (0) | 2021.01.14 |
---|---|
[Chart.js] make chart image (0) | 2021.01.14 |
[Slack] send image (0) | 2021.01.14 |
[Python] datetime, timestamp (0) | 2021.01.14 |
[Java] URLEncode (0) | 2021.01.14 |
[PHP] join -> implode; split -> explode (0) | 2021.01.14 |
댓글