I've been writing a Slack application using Bolt for Python which can open modals and post messages in channels. What I would like is for a way to detect when the messages posted by my app get deleted (ideally with a simple Python decorator), though I am not sure this is possible. The Slack API does seem to have a message_deleted event, though I can't seem to get it to work. I've tried including this handler in my application:
@app.event("message_deleted")
async def message_deleted(ack, body, logger):
logger.info(body)
await ack()
However, nothing happens when I delete the message that was generated by my app. The event handler doesn't trigger, as if Slack doesn't actually send any event data to notify of the message being deleted in the first place.
I also went to my app's settings page and noticed there is a tab to enable Event Subscriptions. I turned that on and pointed it at my handler endpoint. But I still don't appear to receive any of the message_deleted events. And that doesn't seem to be an option available under either Bot Events or Workspace Events.