The Slack app displays a welcome message when a user opens "app home". It's inspired by the "Hello World, Bolt ⚡️ - Building your very first app with Bolt" tutorial.
The app is built with:
Watch the YouTube video or check out Repl.it.
Go to Features > OAuth & Permissions:
- Scopes > Bot Token Scopes > Add an OAuth Scope:
chat:write
- OAuth Tokens for Your Workspace > Install to Workspace
Go to Features > Event Subscriptions:
- Enable Events:
On
- Request URL:
https://my.app.com/slack/events
- Subscribe to bot events > Add Workspace Event:
app_home_opened
- Save Changes
Create .env
from .env.example
:
cp .env.example .env
Copy the Signing Secret:
- Settings > Basic Information > App Credentials > Signing Secret
Copy the Bot User OAuth Token:
- Settings > Install App > OAuth Tokens for Your Workspace > Bot User OAuth Token
Set the environment variables:
SLACK_SIGNING_SECRET=abc123
SLACK_BOT_USER_OAUTH_TOKEN=xoxb-123-456-abc
Run your app:
npm start
Your Bolt app will be listening at: http://localhost:3000/slack/events
Press Ctrl + C to stop the app.
To expose your local server to the public internet, use ngrok:
ngrok http 3000
Update the Request URL in Requirements to your ngrok URL:
https://123abc.ngrok.io
- The
app_home_opened
event gets triggered when a user opens the bot's "app home" for the first time - The app uses the Bolt's
say
method to send a welcome message to the user