【问题标题】:Interactive messages only appear below the last message交互式消息仅显示在最后一条消息下方
【发布时间】:2021-08-31 07:23:48
【问题描述】:

分别点击“批准”和“是”

问题:如上图所示,我在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;
});

【问题讨论】:

    标签: java slack bolt


    【解决方案1】:

    处理松弛消息时,您可以发布新消息或编辑现有消息。

    您使用的实现只能在对话结束时发布消息。

    如果您真的想将您的回复附加到原始消息,那么您应该尝试串接回复。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-01-11
      • 2012-06-04
      • 2019-07-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多