分别点击“批准”和“是”
问题:如上图所示,我在slack中收到了两条消息。无论我单击“批准”按钮还是“是”按钮,返回的消息都只出现在最后一条消息的下方。为什么?我希望返回的消息只会出现在我点击的按钮下。怎么做?
请帮忙,谢谢!
我的代码如下:
app.blockAction("button-action", (req, ctx) -> {
Response respond= ctx.ack();
String value = req.getPayload().getActions().get(0).getValue(); // "button's value"
if (req.getPayload().getResponseUrl() != null) {
// Post a message to the same channel if it's a block in a message
ctx.respond("You " + value + " it");
}
return respond;
});