Skip to content

Creating a Slack App

netwolfuk edited this page Apr 2, 2022 · 1 revision

Since 2021, Slack encourages the use of Slack Apps for connecting to Slack.

A Slack App is the connection that tcChatBot uses to connect to slack to listen for commands and post messages.

The process for creating a Slack App is as follows:

  1. Navigate to https://api.slack.com/apps/ and click the Create New App button
  2. In the popup dialog, choose From an app manifest
  3. Pick a Slack Workspace in which to create your app and click Next.
  4. Replace the existing manifest YAML with the following and then click Next:
    display_information:
      name: tcChatBotApp
    features:
      bot_user:
        display_name: TeamCity
        always_online: true
    oauth_config:
      scopes:
        bot:
          - app_mentions:read
          - chat:write
          - groups:read
          - im:read
          - im:write
          - mpim:read
          - mpim:write
          - channels:read
          - channels:history
    settings:
      event_subscriptions:
        bot_events:
          - message.channels
      interactivity:
        is_enabled: true
      org_deploy_enabled: false
      socket_mode_enabled: true
      token_rotation_enabled: false
    
  5. Review the permissions and then click Create Your app should be created and you are returned to the configuration page for your new App.
  6. Install the app by clicking the Install to Workspace button.
  7. You will be prompted with a message saying tcChatBotApp is requesting permission to access the ?????? Slack workspace. Click Allow to permission the app in your workspace.
  8. Scroll down to App-level Tokens and click Generate Token and Scopes.
  9. Give your token a name. Something like tcChatBotToken will be fine.
  10. Click Add Scope and choose connections:write then click Generate. You are then shown your App Token. Copy this and paste it into the Slack App Token field in the TeamCity bot creation dialog. Switch back to the Slack page, and click Done to close the App dialog
Clone this wiki locally