slack Interface operation

1. create a new app

https://api.slack.com/apps?new_app=1

slack Interface operation

2. Add a Bot User

You can bundle a bot user with your app to interact with users in a more conversational manner.

  • Set button 'Always Show My Bot as Online' to on

slack Interface operation

click the Add Bot User button and then Save Changes.

3. Setting up the Events API (Communication can also be achieved without this operation)

The Events API is a bot's equivalent of eyes and ears. It gives a bot a way to react to posted messages, changes to channels, and other activities that happen in Slack. When these events happen, a data payload will be sent to your bot, and it can use that data to form a useful response. 

  • click the Event Subscriptions feature & Switch the Enable Events toggle to on 
  • configure the Request URL

Events API

 ref: https://github.com/nlopes/slack/blob/master/examples/eventsapi/events.go