7

I have a slash command set up in Slack to go look up some info and post a response message back to the channel. I would like the original slash command message that the user sent ("/whatever go get stuff") to be "replaced" by the response message, so effectively I want to delete the slash command message so the user only sees the response in the channel (similar to how /giphy command works).

My slash command works fine, but I can't figure out how to easily delete the message that triggered the command. I was looking into using the api/chat.delete endpoint, but I don't have enough info to form the POST data because the slash command request doesn't include ts.

Does anyone have an idea about how to get rid of that last message?

Steve Mason
  • 205
  • 1
  • 2
  • 6
  • Nevermind, I think I found my answer by rephrasing the question - use the `response_url` to deliver your response https://stackoverflow.com/questions/35682927/slack-slash-commands-show-response-only-to-channel/35700375 – Steve Mason Apr 25 '18 at 15:34
  • 1
    Possible duplicate of [Delete interactive message (command response) just with Slack Commands API](https://stackoverflow.com/questions/49627080/delete-interactive-message-command-response-just-with-slack-commands-api) – Erik Kalkoken Apr 25 '18 at 19:29

0 Answers0