Reputation: 1221
It is my very first time to write a slack bot and i am wondering how to design it.
The bot supposed to be available and respond to end-users' messages immediately.
The thing is that I need that the bot will also send schedules messages to registered users with automation results.
Use case example:
A user sends a message to the bot and registered to a service that will check for changes in X. On a specific interval, my backend will call an automation that checks for those changes and will send a message to the user with the results.
What will be the best practice for this scenario?
Upvotes: 0
Views: 811
Reputation: 32737
Here is a basic outline.
1. Basic setup
2. Registration
app_mention
) or direct message (message.im
)chat.postMessage
3. Scheduled response
Scheduler calls your app
Your app check if responses are due with a database query
If yes: App sends responses to users via chat.postMessage
(but not more than one message per sec due to rate limiting)
Upvotes: 2