• Модуль: im
  • Путь к файлу: ~/bitrix/modules/im/lib/bot.php
  • Класс: BitrixImBot
  • Вызов: Bot::findBots
static function findBots($fields)
{
	$result = Array();
	if (intval($fields['BOT_ID']) <= 0)
		return $result;

	$bots = self::getListCache();
	if ($fields['TYPE'] == IM_MESSAGE_PRIVATE)
	{
		if (isset($bots[$fields['BOT_ID']]))
		{
			$result = $bots[$fields['BOT_ID']];
		}
	}
	else
	{
		if (isset($bots[$fields['BOT_ID']]))
		{
			$chats = self::getChatListCache($fields['BOT_ID']);
			if (isset($chats[$fields['CHAT_ID']]))
			{
				$result = $bots[$fields['BOT_ID']];
			}
		}
	}

	return $result;
}