【问题标题】:Open a Slack Dialog打开松弛对话框
【发布时间】:2019-08-01 04:34:16
【问题描述】:

我创建了一个交互式消息按钮来打开一个对话框。

这是交互消息端点的应用程序代码。

$httpClient = new GuzzleHttp\Client();

$httpClient->post($interactionRequest->payload->response_url, [
    'json' => [
        'text' => 'dialog open',
        'trigger_id' => $interactionRequest->payload->trigger_id,
        'dialog' => [
            'callback_id' => 'ryde-46e2b0',
            'title' => 'Request a Ride',
            'submit_label' => 'Request',
            'elements' => [
                [
                    'type' => 'text',
                    'label' => 'Pickup Location',
                    'name' => 'loc_origin',
                ],
                [
                    'type' => 'text',
                    'label' => 'Dropoff Location',
                    'name' => 'loc_destination',
                ],
            ],
        ],
    ],
]);

请求成功,我在 json text 属性中定义的消息显示在 slack 中。但是对话框没有打开。

我的代码中缺少什么部分来打开一个对话框?

【问题讨论】:

    标签: php laravel slack slack-api slack-dialog


    【解决方案1】:

    这不起作用,因为您没有使用正确的方法打开对话框。

    如果您想打开 Slack 对话框,您需要将对话框定义连同触发器一起发布到此 API 方法:dialog.open

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-07-24
      • 1970-01-01
      • 2018-11-02
      • 1970-01-01
      • 2018-03-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多