https://github.com/nhsdigital/api-management-slackbot
A slackbot for the API management team.
https://github.com/nhsdigital/api-management-slackbot
Last synced: 7 months ago
JSON representation
A slackbot for the API management team.
- Host: GitHub
- URL: https://github.com/nhsdigital/api-management-slackbot
- Owner: NHSDigital
- Created: 2020-10-20T10:38:45.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-09-06T18:49:12.000Z (over 2 years ago)
- Last Synced: 2024-04-13T07:14:10.192Z (almost 2 years ago)
- Language: JavaScript
- Homepage:
- Size: 2.48 MB
- Stars: 0
- Watchers: 47
- Forks: 1
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# API Management Producer Support Slackbot
## What is this for?
This slackbot is for the purpose of sending automated messages in the platforms-apim-producer-support channel.
- The chat.postEphemeral method sends a message only visible to the message sender.
- The conversations.history method fetches a limited number of messages from the channel history and only post the response if the user has not sent a recent message.
- The Slackbot will listen to channels that it has been installed in.
It is recommended to only install this application in the platforms-apim-producer-support channel.
## Instructions for Creating and Authenticating a Slack Application
### Creating your application
You must be an admin for your workspace to create an application.
1. Visit [Slack Apps](https://api.slack.com/apps/) and create a new app.
2. Name your app and select the NHS Digital Platforms workspace.
3. Your App can be customised in the Basic Information tab.
### Authenticating your application
1. In OAuth & Permissions Scopes must be set. When adding OAuth Scopes the following scopes must be added:
- channels:history
- im:history
- mpim:history
- chat:write
2. Install the app in your workspace.
3. In the Event Subscriptions tab toggle on 'Enable Events' and paste in your hosted endpoint. The endpoint must end with /slack/events.
4. Once this is verified save the changes.
5. On slack, in the platforms-apim-producer-support channel add the app from the channel details section.
### Setting Environment Variables
Within the hosted appliction the following environment variables must be set using the secret and token from the [Slack Apps](https://api.slack.com/apps/) page.
- SLACK_SIGNING_SECRET - Signing Secret found on the Basic Information tab.
- SLACK_BOT_TOKEN - Bot User OAuth Access Token (starting with 'xoxb') found on the OAuth & Permissions tab.
- SLACK_MESSAGE_LIMIT - Limited number of messages fetched to determine if the user has recently posted a message in the channel. The max number is 100.