Search code examples
botsslackslack-api

Slack Bot to see all Direct Message Channels


I am trying to implement a Bot which can get all the Direct Message Channels, all the workspace Users and send Direct Messages to them. If I work with my development workspace everything works as expected but when I try with my company workspace, my Bot is only capable to retrieve the Direct Message Channel it is belonging to. Any idea on how to fix by production Bot.


Solution

  • Thanks to Slack support I got my answer:

    The OAuth Token issued is specific to the user who has installed your app and represents the permission(s) to perform actions on behalf of the user. More detailed information here - https://api.slack.com/docs/oauth. The token can only perform the same actions as the user who installed the app i.e If the user can’t view or post in the channel, they can’t grant permission to something they do not have.