/slack-choose-command

Add a `/choose` command to your workspace

Primary LanguageTypeScriptMIT LicenseMIT

slack-choose-command

Add a /choose command to your workspace.

Usage

  • /choose
    Choose one person from the current channel.
  • /choose 3
    Choose three people from the current channel.
  • /choose 3 from #general
    Choose three people from the general channel.
  • /choose 3 from @foo @bar @baz @qux
    Choose three people of the four.

Install

Create a Heroku application

Deploy

Create a Slack application

Go to the your Slack Apps web page.

  1. Create New app.
  2. Setup application.
  • App Name: As you like.
  • Development Slack Workspace: Select a workspace you want to install this app.
  1. Create App.

Create a Slash Command

In the new application page:

  1. Select Slack Commands from Features menu.
  2. Create New Command.
  3. Setup new command.
  • Command: /choose
  • Request URL: Your Heroku application's URL.
  • Short Description: e.g. "Choose some people".
  • Usage Hint: e.g. "3 from #general".
  • Escape channels, users, and links sent to your app: check
  1. Save.

Setup permission

In the application page:

  1. Select OAuth & Permissions from Features menu.
  2. Add channels:read permission in Select Permission Scopes.

Install an application on your workspace

Select OAuth & Permissions from Features menu:

  1. Install App to Workspace.
  2. Authorize.

Setup environment variables

In the application page:

  1. Select Basic Information from Settings menu.
  2. Note down Verification Token.
  3. Select OAuth & Permissions from Features menu.
  4. Note down OAuth Access Token.

In the Heroku application's settings page:

  1. Select Reveal Config Vars.
  2. Add Verification Token as VERIFICATION_TOKEN.
  3. Add OAuth Access Token as OAUTH_TOKEN.

License

MIT