Slack bot to help you fill out Troi. Uses the Bolt framework and the troi-library to talk with the Troi API.
The following steps for setting up the Slack app are adapted from this tutorial. You need admin rights in your Slack workspace.
- Create New App on api.slack.com/apps --> From scratch
- On the Basic Information page you land, the Signing Secret under App Credentials is the
SIGNING_SECRET
we need - OAuth & Permissions --> Bot Token Scopes --> click Add an OAuth Scope -->
chat:write
,im:history
,users:read
,users:read.email
- Scroll up to OAuth Tokens for Your Workspace and click Install to Workspace
- After that, a Bot User OAuth Token gets generated, that's the
BOT_USER_OAUTH_TOKEN
we need - Under Socket Mode (left sidebar) turn on Enable Socket Mode, here you create the
SOCKET_MODE_TOKEN
- Under Event Subscriptions (left sidebar) turn on Enable Events and add the Bot User Events
message.im
- Under App Home (left sidebar) show bot as always online if you want to and set the checkmark below the turned on Messages Tab to active
- Under App Manifest (left sidebar) set
messages_tab_enabled
totrue
(as seen here) --> Save Changes - If you make changes to scopes/permissions etc., reinstall the your app to the Workspace (under Basic Information, Install your app)
npm i
Create ./config.json
:
{
"TROI_API_URL": "",
"TROI_CLIENT_NAME": "",
"TROI_USERNAME": "",
"TROI_PASSWORD": "",
"SLACK_BOT_USER_OAUTH_TOKEN": "",
"SLACK_SIGNING_SECRET": "",
"SLACK_SOCKET_MODE_TOKEN": "",
"GOOGLE_SHEETS_API_KEY": "",
"GOOGLE_SHEET_TROI_SAYINGS_ID": ""
}
npm start