1
votes

I have a bot integrated with the slack API, but can't figure out how to give it the correct scope to "access content in your public channels" as listed here.

I've tried: channels:read,channels:write,chat:write:bot

but that ends up giving me a description of "Access and modify information about your public channels" instead.

1
Are you using a custom bot or a bot library of some sort? Also what language are you using? - nateevans
Could you specify which API methods you are trying to use? - Régis B.
I place my scope as a get parameter in the initial API petition, like so: oauth_xhr.open("GET", "slack.com/oauth/authorize?client_id=" + process.env.SLACK_CLIENT_ID + "&scope=bot", true); - dannyk

1 Answers

1
votes

Your bot is already able to read content in the channels it is present in (see the methods available to bot users here)

Your question is a bit imprecise as to what you want to achieve. With only the "bot" scope, the bot can read all messages posted in channels it has been invited to. If you want your app to be able to invite the bot in all channels, so as to monitor all content posted in public channels, you'll need to require the scope 'channel:write'. This will give you access to the method 'channel.join' and 'channel.invite'

Remember that if you follow this route, the channel scope will be attached to the user token, not the bot token. In other words, your app will make the user granting the authorization to invite the bot in the public channels.