slack-api - Slack static_select 避免在更改时调用后端

标签 slack-api

我有一个带有 static_select 的松弛模态

{
      block_id: "my_block_id",
      type: "section",
      text: {
        type: "mrkdwn",
        text: "Please select one"
      },
      accessory: {
        type: "static_select",
        action_id: "select_type",
        placeholder: {
          type: "plain_text",
          text: "Select one"
        },
        options: self.types_options
      }
    },

当用户选择其中一个选项时会触发后端调用,我是否可以避免这种情况并在点击提交表单按钮时触发调用?

最佳答案

将你的 static_select 放在 input 中而不是部分

When someone uses an interactive component in your app's modal views, the app will receive a block_actions payload.

This does not apply to components included in an input block (see below for details about those).

https://api.slack.com/surfaces/modals/using#components

Any interactive components used within input blocks will not send this block_actions payload. They are included in view_submission payloads only.

https://api.slack.com/reference/interaction-payloads/block-actions

关于slack-api - Slack static_select 避免在更改时调用后端,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59075388/

相关文章:

slack - 如何在 Slack setTopic API 中链接用户名

ios - 在 Swift 中调用 Slack Webincoming 钩子(Hook)但得到 "interrupted, reason: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)"

slack - 通过传入的 webhook 发送消息时出现 channel_not_found 异常

slack - Slack App安装中的环境变量?

javascript - 使用 axios 上传图片到 Slack

slack-api - Slack + Botkit : Automatic reconnect after RTM closure

slack-api - 附件字段的最大长度

json - 如何读取服务状态并通过 bash 中的 JSON 将其传递到 Slack

javascript - Slack API : Ignore deleted/deactivated users on a conversations. 成员请求

webhooks - Slack 传入 Webhook 与 postMessage Web API