Listener Types

Ehsan Abbasi edited this page Jun 18, 2017 · 23 revisions

Depending on the way that the framework interacts with Slack the right configurations need to be set in src/Botonomous/Config.php. Currently, the following methods are supported:

  • Slash Commands
  • Events API

Slash Command Configurations

If you have chosen Slash Commands to create your application you need to set the following configurations:

  • listener -> slashCommand
  • verificationToken -> This can be found at https://api.slack.com/apps/YOUR_APP_ID_GOES_HERE/general

Events API Configurations

  • listener -> event
  • verificationToken -> This can be found at https://api.slack.com/apps/YOUR_APP_ID_GOES_HERE/general
  • clientId -> This can be found at https://api.slack.com/apps/YOUR_APP_ID_GOES_HERE/general
  • clientSecret -> This can be found at https://api.slack.com/apps/YOUR_APP_ID_GOES_HERE/general
  • appId -> This can be found in the this URL: https://api.slack.com/apps/YOUR_APP_ID_GOES_HERE/general
  • oAuthToken -> This refers to OAuth Access Token and can be found at https://api.slack.com/apps/YOUR_APP_ID_GOES_HERE/oauth
  • botUserToken -> This refers to Bot User OAuth Access Token and can be found at https://api.slack.com/apps/YOUR_APP_ID_GOES_HERE/oauth
  • botUserId -> If the app is used internally the only way is to check the raw request from slack, otherwise once a team authorises your app, you will receive the bot user id as well as the access token. In order to record the chat logs chatLogging can be set to true in the configs e.g. <@U4U58QKGS> /ping in this case bot id is: U4U58QKGS

Also in https://api.slack.com/apps/YOUR_APP_ID_GOES_HERE/event-subscriptions make sure your app is at least subscribed to message.channels and message.im events.