我创建了一个交互式消息按钮来打开一个对话框。
这是交互消息端点的应用程序代码。
$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',
],
],
],
],
]);
请求成功,并且我在jsontext
属性中定义的消息显示在松弛中。但是对话框没有打开。
打开对话框的代码缺少什么?
这不起作用,因为您没有使用正确的方法打开对话框。
如果要打开Slack对话框,则需要将对话框定义和触发器一起发布到此API方法:dialog.open。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句