1

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!

1 Answers1

1

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"]);