Sample Slack app that uses the Events API and interactive message to help enforce channel naming conventions
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

README.md

Channel Naming Slack App Template

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.

channel-naming

Setup

Create a Slack app

  1. Create an app at (https://api.slack.com/apps)[https://api.slack.com/apps]
  2. At Bot Users, add a new bot user.
  3. Click on OAuth & Permissions and add the following scopes:
    • channels:read
    • chat:write:bot
  4. Enable the interactive messages (See below Enable Interactive Messages)
  5. Click 'Save Changes' and install the app to all channels (You should get an OAuth access token after the installation

Run locally or Remix on Glitch

  1. Get the code
  2. Set the following environment variables in .env (copy from .env.sample):
    • SLACK_TOKEN: Your app's xoxb- token (available on the Install App page)
    • SLACK_VERIFICATION_TOKEN: Your app's Verification Token (available on the Basic Information page)
  3. If you're running the app locally:
    • Start the app (npm start)
  4. Enable the events (See below Enable the Events API)

Enable the Events API

  1. Click on Events Subscriptions and enable events.
  2. Set the Request URL to your server (e.g. https://yourname.ngrok.com) or Glitch URL + /events
  3. On the same page, scroll down to Subscribe to Bot Events and subscribe to the channel_created and channel_rename events.

Enable Interactive Messages

  1. Click on Interactive Components and enable the feature.
  2. Set the Request URL to your server URL + /interactions

In Slack

  1. Create a new channel