• Модуль: imbot
  • Путь к файлу: ~/bitrix/modules/imbot/lib/service/notifier.php
  • Класс: BitrixImBotServiceNotifier
  • Вызов: Notifier::notifyCertainUser
static function notifyCertainUser(array $params): Result
{
	$result = new Result;

	$classSupport = self::detectSupportBot();

	/** @see BitrixImBotBotNetwork::onReceiveCommand */
	$commandResult = $classSupport::onReceiveCommand(
		ImBotBotNetwork::COMMAND_OPERATOR_MESSAGE_ADD,
		[
			'MESSAGE_ID' => (int)$params['MESSAGE_ID'],
			'BOT_ID' => $classSupport::getBotId(),
			'BOT_CODE' => $classSupport::getBotCode(),
			'DIALOG_ID' => $params['DIALOG_ID'],
			'MESSAGE' => $params['MESSAGE'],
			'URL_PREVIEW' => $params['URL_PREVIEW'] === 'N' ? 'N': 'Y',
			'ATTACH' => $params['ATTACH'] ?? '',
			'KEYBOARD' => $params['KEYBOARD'] ?? '',
			'PARAMS' => [
				ImBotBotNetwork::MESSAGE_PARAM_ALLOW_QUOTE => 'Y',
				'IMB_MENU_ACTION' => 'SKIP:MENU', /** @see BitrixImbotBotMixinMESSAGE_PARAM_MENU_ACTION */
			],
		]
	);
	if ($commandResult instanceof ImBotError)
	{
		$result->addError(new MainError($commandResult->msg, $commandResult->code));
	}

	return $result;
}