SlackApiError: The server responded with: {'ok': False, 'error': 'not_in_channel'}

Viewed 1018

I am trying to post an image to slack with the following piece of code:

import slack
from slack import WebClient
client = slack.WebClient(token=XXX)

response = client.files_upload(    
        file = open("credit_temp.jpg","w"),
        channels='#test_pandl'
    )

But I have the following error message:

SlackApiError: The request to the Slack API failed.
The server responded with: {'ok': False, 'error': 'not_in_channel'}

Hereunder are the bot token scopes:

The bot scope token had every access possible

any idea what is happening?

0 Answers
Related