【发布时间】:2021-08-31 05:57:09
【问题描述】:
问题: 当我单击“是”按钮时,按钮下方会出现一条消息,但一段时间后,该消息会自动消失。为什么?如何解决这个问题呢? 代码如下:
//
app.blockAction("button-action", (req, ctx) -> {
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've sent " + value + " by clicking the button!");
}
return ctx.ack();
});
【问题讨论】:
-
您在问为什么消息消失了?这可能是您 UI 上的其他一些组件,您通过
ctx发送的响应会被路由到该组件。