我正在制作一个聊天机器人应用程序,用于搜索航班。找到航班后,我将返回一个带有按钮的轮播,并希望用户在单击按钮后将其重定向到该网站。它起作用了,唯一的问题是单击按钮会将URL放入对话中。有什么方法可以打开URL而不进行对话吗?
我要发送到Viber REST API的JSON:
{
"type":"rich_media",
"min_api_version":6.8,
"receiver":"asmS1TwIYkPVxpod3rNCYg==",
"rich_media":{
"Type":"rich_media",
"ButtonsGroupColumns":6,
"ButtonsGroupRows":7,
"Buttons":[
{
"Columns":6,
"Rows":4,
"ActionType":"open-url",
"OpenURLType":"external",
"ActionBody":"http://localhost:60219/Booking?flightId=1&sessionid=3b0f51f5-cf88-4d1e-a64b-1222e19b4702&adults=1&children=0&infants=0",
"Text":"<b>Best Offer - 68.99 EUR</b><br />Bratislava to Nis on 18Oct at 14:10",
"Image":"http://localhost:60219/api/v1/FlightInfo/FlightDetail/Viber?flightId=1&returnFlightId=",
"TextVAlign":"bottom",
"TextHAlign":"center"
},
{
"Columns":6,
"Rows":1,
"ActionType":"open-url",
"OpenURLType":"external",
"ActionBody":"http://localhost:60219/Booking?flightId=1&sessionid=3b0f51f5-cf88-4d1e-a64b-1222e19b4702&adults=1&children=0&infants=0",
"Text":"DEMO booking",
"TextVAlign":"center",
"TextHAlign":"center"
},
{
"Columns":6,
"Rows":1,
"ActionType":"open-url",
"OpenURLType":"external",
"ActionBody":"https://www.ryanair.com/gb/en/booking/home/BTS/INI/2019-10-18//1/0/0/0",
"Text":"Book now",
"TextVAlign":"center",
"TextHAlign":"center"
},
{
"Columns":6,
"Rows":1,
"ActionType":"open-url",
"OpenURLType":"external",
"ActionBody":"http://localhost:60219/FlightDetail?flightid=1",
"Text":"Flight Details",
"TextVAlign":"center",
"TextHAlign":"center"
},
{
"Columns":6,
"Rows":4,
"ActionType":"open-url",
"OpenURLType":"external",
"ActionBody":"http://localhost:60219/PriceAlert?departureAirportId=ce43057e-afe6-4592-8759-9ea9643bb566&arrivalAirportId=3f43e185-bba3-4216-813d-473bfdbb024d",
"Text":"<b>Set the Price Alert for BTS-INI</b><br …Run Code Online (Sandbox Code Playgroud) 如何删除我的机器人发送给用户的消息?如果消息包含按钮会影响它们吗?它们会消失吗?删除按钮的最佳方法是什么?
我正在使用 PHP 通过 Viber REST API 创建 Viber 机器人。我试图了解如何创建 Viber 的键盘设计集,但无济于事。如何让它看起来像 Viber 提供的键盘设计示例一样?
[
[
'Columns' => 3,
'Rows' => 2,
'Text' => '<font color=\"#494E67\">Smoking</font><br><br>',
'TextSize' => 'medium',
'TextHAlign' => 'center',
'TextVAlign' => 'bottom',
'ActionType' => 'reply',
'ActionBody' => 'Smoking',
'BgColor' => '#f7bb3f',
'Image' => 'https://img.icons8.com/material-outlined/24/000000/smoking.png',
],
[
'Columns' => 3,
'Rows' => 2,
'Text' => '<font color=\"#494E67\">Non Smoking</font><br><br>',
'TextSize' => 'medium',
'TextHAlign' => 'center',
'TextVAlign' => 'bottom',
'ActionType' => 'reply',
'ActionBody' => 'Non smoking',
'BgColor' => '#f6f7f9',
'Image' => …Run Code Online (Sandbox Code Playgroud) 我需要一个深层链接,可以重定向到 Viber 上的特定号码。我现在已经有了这个,但它在计算机上正常工作,而不是在手机上。
<a id="viber" href="viber://pa?chatURI=<+38163600583>">Viber</a>
Run Code Online (Sandbox Code Playgroud)
我看到了这个https://developers.viber.com/docs/tools/deep-links/并按照文档所述对其进行了编辑,但它仍然无法在手机上运行。我尝试了 without 和 with+和 without it (+数字前面的)或 without <>,但仍然不起作用。
有什么想法吗?