Reputation: 50
This is a smaller piece of a larger program, but to zero in on this specific issue, I've been having quite a bit of trouble recently setting up a program in python using the slackclient module that can invite a user to a private channel (called groups in the API). The program has 2 tokens, one for the bot and one for the actual app.
My issue is that while I can invite the bot to the private channel it should be inviting people to, bots can't have the required scopes to do so. If I switch over to the app token which does have those scopes, it can't complete the operation because apps can't be invited to a channel.
The documentations for this API Call can be found here.
This is the invite command I'm using:
SlackClient(slack_token).api_call("groups.invite", channel='GXXXXXXXX', user='UXXXXXXXX')
While the bot can access the channel information, attempting to invite someone with the bot returns this error:
'error': 'missing_scope', 'provided': 'identify,bot:basic', 'ok': False, 'needed': 'groups:write'
Switching to the app token returns this error:
'error': 'channel_not_found', 'ok': False
Am I missing something here? Or is it intentional that apps not be allowed to invite users to private channels at all?
Upvotes: 0
Views: 612
Reputation: 32837
The reason this does not work is as follows:
Upvotes: 1