【问题标题】:Slack development松弛发展
【发布时间】: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 发送的响应会被路由到该组件。

标签: java slack bolt


【解决方案1】:

消息可能正在消失,因为它是短暂消息。

至于为什么这是短暂的,原因在于解决方案的实施。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-03-24
    • 2020-11-14
    • 1970-01-01
    • 1970-01-01
    • 2018-12-24
    • 1970-01-01
    • 2016-01-11
    • 1970-01-01
    相关资源
    最近更新 更多