Table of Contents generated with DocToc
Slackbot appears for all hackers, click button to ask for help. Bot asks for question.
- Mentees interact with the BOT through DM.
Welcome Message | Request Popup |
---|---|
-
The bot posts the request into the private channel of mentors. It will tag mentors with the relevant skill.
-
Mentor can claim the request, at which point a DM is created between the mentor, the requester, and the bot
-
The Mentor will receive controls via DM to close the request if it’s done, or surrender it back into the queue if they cannot do it
-
Bot pings a stats channel (e.g. #general) every 3 hours with updates and how to get in touch for help
-
Old, unclaimed requests are automatically bumped every 10 min if nobody has responded to it
- Mentors can set their skills with the bot through the
!skills
command in DM - The bot automatically rescans the slack users list every 15 minutes. To have someone be a mentor, simply add them to the private mentors channel.
- All mentors have access to an additional
!stats
command to manually trigger a stats post.
The bot will automatically report any runtime errors to the private mentors channel (tagging the mentor lead in the process!).
This app is written in TypeScript and uses a local lowdb
json database to store sessions. This json database file is automatically generated at runtime as src/storage/db.json.
This bot requires a custom slack app to work. In particular, it requires the following Slack API components:
- Interactive Components
- Request url:
- Event Subscriptions
- Request url:
- Bot events:
- app_mention
- im_created
- message.groups
- message.im
- Workspace events:
- team_join
- Bots
- Set up the display name and default username as you wish
- Permissions
- Redirect url:
- Required scopes:
- chat:write:bot
- groups:write
- bot (Add Bot User)
- users:read
Configuration parameters are stored in src/config/index.ts. A sample configuration file is provided in this repo.
If you're installing the bot onto your Slack through "distribution", you can get the relevant bot access token by simply installing it through the "manage distribution" page of your Slack app. 1. Click the "Add to Slack" button 2. Click "Allow" 3. Find your bot access token! (starts with xoxb)
Remember to add your app to the channels your bot will post in, in particular the private mentors channel and the stats channel.
You can find User IDs, Channel IDs, and Group IDs in the URL on Slack.
We use Kubernetes and Skaffold. You will find the Kubernetes configuration file that we use in kubernetes/deployment.yaml. Please feel free to use it as a template for your deployments.
- lowdb for local document storage
- TypeScript
- Node Slack SDK