• Модуль: im
  • Путь к файлу: ~/bitrix/modules/im/lib/bot.php
  • Класс: BitrixImBot
  • Вызов: Bot::sendPullOpenDialog
static function sendPullOpenDialog(int $botId, int $userId = null): bool
{
	if (!BitrixMainLoader::includeModule('pull'))
	{
		return false;
	}

	$userId = Common::getUserId($userId);
	if (!$userId)
	{
		return false;
	}

	$botForJs = self::getListForJs();
	if (!isset($botForJs[$botId]))
	{
		return false;
	}

	return BitrixPullEvent::add($userId, [
		'module_id' => 'im',
		'expiry' => 10,
		'command' => 'dialogChange',
		'params' => [
			'dialogId' => $botId
		],
		'extra' => BitrixImCommon::getPullExtra()
	]);
}