Context: I work at a small MSP and I've created a bot that direct messages employees when one of their tickets goes overdue. The message has a few buttons that allow the user to request an extension on the ticket. Once a button is clicked, our ticketing system's API is used to update the ticket and the chat message updates to reflect the selected update.
What I'd like to do after one of the request extension buttons is clicked is to ask the user if they would like to add a note to the ticket. If Yes button is clicked, the bot would prompt the user to respond with a note to add.
Here's my question. Is there any way to read the next message from the user after they click yes? As in, should the user click 'Yes' to add a note, can I trigger a script to run when the next user message is posted?
For what it's worth, I'm writing this in PHP. I'm using chat.postMessage
to post the message when a ticket goes overdue, and simply "replacing" the message with a new one using that message's responseURL
when a button is clicked.
Any Slack API gurus out there with any ideas?