Is it possible to post files to Slack through python?

Now, slack has restricted creating tokens for new users, so how can I (new to slack) send some files through slack using python.

import pandas as pd import numpy as np import requests import json  web_hook_url = 'https://hooks.slack.com/services/......' #  api.slack.com/custom-integrations/legacy-tokens.  file_path = "Firefox_wallpaper.png"  with open(file_path , "rb") as f:     slack_msg = {'filename':'Firefox_wallpaper.png',                  'token':'what should I write here',                 'channels':'demotest'}     requests.post(web_hook_url,params = slack_msg, files={'file':f})       # print(slack_msg) 
Add Comment
0 Answer(s)

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.