• Модуль: imbot
  • Путь к файлу: ~/bitrix/modules/imbot/lib/bot/giphy.php
  • Класс: BitrixImBotBotGiphy
  • Вызов: Giphy::unRegister
static function unRegister()
{
	if (!BitrixMainLoader::includeModule('im'))
		return false;

	$appList = Array();
	$apps = BitrixImApp::getListCache();
	foreach ($apps as $app)
	{
		if ($app['BOT_ID'] != self::getBotId())
			continue;

		$appList[] = $app['HASH'];
	}

	$result = BitrixImBot::unRegister(Array('BOT_ID' => self::getBotId()));
	if ($result)
	{
		self::setBotId(0);

		$http = new BitrixImBotHttp(self::BOT_CODE);
		foreach ($appList as $hash)
		{
			$http->query(
				'UnregisterIframe',
				Array('HASH' => $hash)
			);
		}
	}

	return $result;
}