Search code examples
slack-apislack

Receiving notifications from Slack Direct messages


I'm building a simple slack bot and can currently send private messages as well as checking for the last 10 messages received within this one-to-one channel.

Is there a way of getting a POST notification to my webservice whenever the user replies, instead of having to poll and continuously check messages on that one-to-one channel?


Solution

  • Bots generally work by connecting to the real-time messaging API, a WebSocket-based API that sends you events as they happen. Specifically, you should see a message event sent to you every time a message visible to your bot is sent.

    To answer your question, there's no way to get an HTTP POST sent to you instead; you'll need to connect to the RTM API and listen for events that way.