✨ Updated October 2018: As we have introduced some new features, this tutorial and the code samples have been updated! All the changes from the previous version of this example, read the DIFF.md
An example app that helps enforce channel naming conventions.
- Create an app at (https://api.slack.com/apps)[https://api.slack.com/apps]
- At Bot Users, add a new bot user.
- Click on OAuth & Permissions and add the following scopes:
channels:read
chat:write:bot
- Enable the interactive messages (See below Enable Interactive Messages)
- Click 'Save Changes' and install the app to all channels (You should get an OAuth access token after the installation
- Get the code
- Either clone this repo and run
npm install
- Or visit https://glitch.com/edit/#!/remix/slack-channel-naming-blueprint
- Either clone this repo and run
- Set the following environment variables in
.env
(copy from.env.sample
):SLACK_TOKEN
: Your app'sxoxb-
token (available on the Install App page)SLACK_VERIFICATION_TOKEN
: Your app's Verification Token (available on the Basic Information page)
- If you're running the app locally:
- Start the app (
npm start
)
- Start the app (
- Enable the events (See below Enable the Events API)
- Click on Events Subscriptions and enable events.
- Set the Request URL to your server (e.g.
https://yourname.ngrok.com
) or Glitch URL +/events
- On the same page, scroll down to Subscribe to Bot Events and subscribe to the
channel_created
andchannel_rename
events.
- Click on Interactive Components and enable the feature.
- Set the Request URL to your server URL +
/interactions
- Create a new channel