0

Hello Slack java SDK Experts,

I have a button, in slack app which when clicked once should get disabled. I read about the ChatUpdateRequest where people have suggested using this for the purpose at hand. W.r.t. code snippet below, the messageTs is what I capturing from the message which I received when the button was clicked.

        ChatUpdateRequest chatUpdateRequest = ChatUpdateRequest
            .builder()
            .ts(messageTs)
            .channel(getSlackUserByEmail(slackActionRequest.getUserEmail()).getId())
            .text("request is captured: " + slackActionRequest.getStatus())
            .build();
        ChatUpdateResponse chatUpdateResponse = slack.methods(token).chatUpdate(chatUpdateRequest);
        if (!chatUpdateResponse.isOk()) {
            LOGGER.warn("chat update response failed: " + chatUpdateResponse.getError());
        }

This piece of code always runs into message_not_found error from slack API. I am not sure where am I going wrong. Also must say Slack java SDK needs some love in terms of documentation, it is poorly documented or rather not documented at all.

Rax
  • 323
  • 1
  • 5
  • 17

0 Answers0