Version 5 (modified by 7 years ago) (diff) | ,
---|
Documentation
Range of chatbot's functonality depends on scopes (or in other words, list of API calls chatbot is allowed to use). These can be set in https://api.slack.com/ for your app in OAuth & Permissions tab. These scopes automatically apply (after admin's confirmation) to your bot and user tokens which are used in source:constants.py. The *.history call is currently the most important one as it is responsible for collecting history of channels.
Scopes for .history API call:
- channels.history: collects history only from SLACK public channels
- groups.history: same as with channels, but this one works only for private channels
- im.history: collects chat history from private conversations
- mpim.history: collects chat history from multi-party conversations
- conversations.history: universal scope for all 4 API calls mentioned above, it's functionality depends on which of those 4 scopes is chatbot allowed to use. For example: if chatbot is allowed to view groups and channels but not allowed to view private messages and multi-party conversations, those API-calls get rejected automatically without limiting other scope
Current implementation uses conversations.history. That allows users to set up the app using any combination of these 4 permissions (it obviously needs to have 1 or more) limiting the bot's functionality to certain types of channels.
List of potentionally useful information that can be obtained with SLACK API calls:
- channels.history:
- list of all messages, events
- timestamps of these messages
- users.info:
- name, real name, team name, e-mail
- info about user being admin, owner, bot, restriced/ultra-restricted
- channels.info:
- all members
- scope of the channel (private, public, mpim..)
- latest message
- number of unread messages
- topic
- previous names