• Модуль: imbot
  • Путь к файлу: ~/bitrix/modules/imbot/lib/bot/network.php
  • Класс: BitrixImBotBotNetwork
  • Вызов: Network::sendUnregisterRequest
static function sendUnregisterRequest($code, $botId): bool
{
	$http = self::instanceHttpClient();

	$result = $http->query(
		'UnRegisterBot',
		['CODE' => $code, 'BOT_ID' => $botId],
		true
	);

	if (isset($result['error']))
	{
		$message = Loc::getMessage('IMBOT_NETWORK_ERROR_'.mb_strtoupper($result['error']['code']));
		if (empty($message))
		{
			$message = $result['error']['msg'];
		}
		self::$lastError = new ImBotError(
			__METHOD__,
			$result['error']['code'],
			$message
		);

		return false;
	}

	return true;
}