Skip to content

Instantly share code, notes, and snippets.

@marvinhoxha
Created September 8, 2022 13:26
Show Gist options
  • Save marvinhoxha/32a30ceaa168c9b041ed9d5d0d13b97b to your computer and use it in GitHub Desktop.
Save marvinhoxha/32a30ceaa168c9b041ed9d5d0d13b97b to your computer and use it in GitHub Desktop.
def send_photo_to_slack(result):
image = open("foo.png", 'rb').read()
client = WebClient("Slack_Bot_User_OAuth_Token") #input OAuth token
client.files_upload(
channels = "Slack_channel_id", #input channel id
initial_comment = f"{result}",
filename = "dog photo",
content = image
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment