在Bitrix聊天机器人中配置链接预览的显示

发布于 2025-02-07 14:09:41 字数 1549 浏览 0 评论 0原文

我是初学者。

我的目标是:在Bitrix中创建一个按需加载新闻的聊天机器人。

问题:链接(更确切地说,列表中的第一个链接)显示为消息底部的预览。如何关闭它?

相关的难度:如果机器人消息太大,则必须向下滚动以查看bot消息。如何修复它?

$arResult = array(
                'title' => '[B]Актуальные новости IT - HABR.COM[/B]',
                'report'  => 
                            "\n" . '[ICON=https://emoji-uc.akamaized.net/orig/09/f815148913a719eb63263593996d54.png title=Смайлик] '
                                    . $Myarr[0] . '. ' . '[URL=' . $Myarrlink[0] . ']Читать далее ➤' . '[/URL]' .
                            "\n\n" . '[ICON=https://emoji-uc.akamaized.net/orig/09/f815148913a719eb63263593996d54.png title=Смайлик] '
                                    . $Myarr[1] . '. ' . '[URL=' . $Myarrlink[1] . ']Читать далее ➤' . '[/URL]' .
                            "\n\n" . '[ICON=https://emoji-uc.akamaized.net/orig/09/f815148913a719eb63263593996d54.png title=Смайлик] '
                                    . $Myarr[2] . '. ' . '[URL=' . $Myarrlink[2] . ']Читать далее ➤' . '[/URL]' .
                            "\n\n" . '[ICON=https://emoji-uc.akamaized.net/orig/09/f815148913a719eb63263593996d54.png title=Смайлик] '
                                    . $Myarr[3] . '. ' . '[URL=' . $Myarrlink[3] . ']Читать далее ➤' . '[/URL]' .       
                           
                            "\n\n" . "[I]Обновлено: [/I]" . "[I]" . $curDay . "[/I]"
                );

在此处输入图像描述

谢谢!

I am a beginner developer.

My goal: creating a chat bot in Bitrix with loading news on demand.

Problem: Links (more precisely, the first link from the list) are displayed as previews at the bottom of the message. How to turn it off?

Associated difficulty: In the case where the bot message is too large, you have to scroll down to view the bot message. How to fix it?

$arResult = array(
                'title' => '[B]Актуальные новости IT - HABR.COM[/B]',
                'report'  => 
                            "\n" . '[ICON=https://emoji-uc.akamaized.net/orig/09/f815148913a719eb63263593996d54.png title=Смайлик] '
                                    . $Myarr[0] . '. ' . '[URL=' . $Myarrlink[0] . ']Читать далее ➤' . '[/URL]' .
                            "\n\n" . '[ICON=https://emoji-uc.akamaized.net/orig/09/f815148913a719eb63263593996d54.png title=Смайлик] '
                                    . $Myarr[1] . '. ' . '[URL=' . $Myarrlink[1] . ']Читать далее ➤' . '[/URL]' .
                            "\n\n" . '[ICON=https://emoji-uc.akamaized.net/orig/09/f815148913a719eb63263593996d54.png title=Смайлик] '
                                    . $Myarr[2] . '. ' . '[URL=' . $Myarrlink[2] . ']Читать далее ➤' . '[/URL]' .
                            "\n\n" . '[ICON=https://emoji-uc.akamaized.net/orig/09/f815148913a719eb63263593996d54.png title=Смайлик] '
                                    . $Myarr[3] . '. ' . '[URL=' . $Myarrlink[3] . ']Читать далее ➤' . '[/URL]' .       
                           
                            "\n\n" . "[I]Обновлено: [/I]" . "[I]" . $curDay . "[/I]"
                );

enter image description here

Thank you!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

橘和柠 2025-02-14 14:09:41

因此,'url_preview'=> 'n'创建消息时。在Bitrix中,此预览称为“富格式”)

示例:

restCommand('imbot.message.add', Array(
"DIALOG_ID" => $_REQUEST['data']['PARAMS']['DIALOG_ID'],
"MESSAGE" => "http://bitrix24.ru",
'URL_PREVIEW' => 'N' 
), $_REQUEST["auth"]);

在我的版本中:

$result = restCommand('imbot.message.add',
    array(
        "DIALOG_ID" => $_REQUEST['data']['PARAMS']['DIALOG_ID'],
        "MESSAGE"   => $arReport['title'] . "\n" . $arReport['report'] . "\n",
        "ATTACH"    => array_merge(
            $arReport['attach']
        ),
        "URL_PREVIEW" => 'N' 
    ),
    $_REQUEST["auth"]);

So, 'URL_PREVIEW' => 'N' when you create a message. In Bitrix, this preview is called "Rich Formatting")

Example:

restCommand('imbot.message.add', Array(
"DIALOG_ID" => $_REQUEST['data']['PARAMS']['DIALOG_ID'],
"MESSAGE" => "http://bitrix24.ru",
'URL_PREVIEW' => 'N' 
), $_REQUEST["auth"]);

In my version:

$result = restCommand('imbot.message.add',
    array(
        "DIALOG_ID" => $_REQUEST['data']['PARAMS']['DIALOG_ID'],
        "MESSAGE"   => $arReport['title'] . "\n" . $arReport['report'] . "\n",
        "ATTACH"    => array_merge(
            $arReport['attach']
        ),
        "URL_PREVIEW" => 'N' 
    ),
    $_REQUEST["auth"]);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文