• Модуль: imbot
  • Путь к файлу: ~/bitrix/modules/imbot/lib/service/openlines.php
  • Класс: BitrixImBotServiceOpenlines
  • Вызов: Openlines::sendCommand
static function sendCommand(string $command, array $params): bool
{
	$constList = (new ReflectionClass(__CLASS__))->getConstants();
	$whiteList = [];
	foreach ($constList as $const => $value)
	{
		if (strpos($const, 'COMMAND_', 0) === 0)
		{
			$whiteList[] = $value;
		}
	}
	if (in_array($command, $whiteList, true))
	{
		$http = self::instanceHttpClient();
		$query = $http->query($command, $params, true);

		return !isset($query->error);
	}

	return false;
}