I'm trying to upload a local file I have to slack, and then attach it to a message that I am sending, but when I run my script I just get the message text, no file. Any help would be appreciated.
Thanks.
client = slack_sdk.WebClient(token=SLACK_TOKEN)
response=client.files_upload(file='1.jpg')
payoff=response['file']['permalink']
attachment='[{"text": "r", "image_url": "'+payoff+'"}]'
client.chat_postMessage(channel='#testChannel', text="Sample Text", username='Bot name', attachment=attachment, icon_emoji=':emoji:')