공부
[Slack] send image
승가비
2021. 1. 14. 07:36
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