• Модуль: im
  • Путь к файлу: ~/bitrix/modules/im/classes/general/im_rest.php
  • Класс: CIMRestService
  • Вызов: CIMRestService::OnRestAppDelete
static function OnRestAppDelete($arParams)
{
	if(!BitrixMainLoader::includeModule('rest'))
	{
		return;
	}
	$result = BitrixRestAppTable::getList(array('filter' =>array('=ID' => $arParams['APP_ID'])));
	if ($result = $result->fetch())
	{
		$bots = BitrixImBot::getListCache();
		foreach ($bots as $bot)
		{
			if ($bot['APP_ID'] == $result['CLIENT_ID'])
			{
				BitrixImBot::unRegister(Array('BOT_ID' => $bot['BOT_ID']));
			}
		}
	}
}