275 'data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2228%22%20'
276 .
'height%3D%2228%22%20viewBox%3D%220%200%2028%2028%22%3E%0A%20%20%3Cg%20fill%3D%22none%22%20'
277 .
'fill-rule%3D%22evenodd%22%3E%0A%20%20%20%20%3Ccircle%20cx%3D%2214%22%20cy%3D%2214%22%20r%3D%2214%22%20'
278 .
'fill%3D%22%232FC6F6%22%2F%3E%0A%20%20%20%20%3Cpath%20'
279 .
'fill%3D%22%23FFFFFF%22%20d%3D%22M19.053132%2C10.0133936%20L19.9184066%2C7.09247624%20C19'
280 .
'.9937984%2C6.83851954%2019.930205%2C6.56296095%2019.7515811%2C6.36960075%20C19.5729573%2C6'
281 .
'.17624054%2019.3064404%2C6.09445472%2019.0524247%2C6.15505122%20C18.798409%2C6.21564772%2018'
282 .
'.5954856%2C6.40942049%2018.5200937%2C6.66337719%20L17.7789513%2C9.17078557%20C15.4748028%2C7'
283 .
'.94807693%2012.7275787%2C7.95098931%2010.4259431%2C9.17858062%20L9.68114981%2C6.66337719%20C9'
284 .
'.56460406%2C6.27079414%209.15710205%2C6.04859979%208.77096861%2C6.16709222%20C8.38483517%2C6'
285 .
'.28558465%208.16629117%2C6.69989319%208.28283693%2C7.09247624%20L9.15176243%2C10.0249005%20C7'
286 .
'.2004503%2C11.6106349%206.0672511%2C14.0147948%206.0740137%2C16.5545557%20C6.0740137%2C21.1380463%209'
287 .
'.67019697%2C20.0133316%2014.1097491%2C20.0133316%20C18.5493013%2C20.0133316%2022.1454845%2C21'
288 .
'.1380463%2022.1454845%2C16.5545557%20C22.1533008%2C14.0079881%2021.0139427%2C11.5979375%2019'
289 .
'.053132%2C10.0133936%20Z%20M14.1024472%2C15.9316939%20C10.9334248%2C15.9316939%208.36315777%2C16'
290 .
'.2657676%208.36315777%2C14.9001487%20C8.36315777%2C13.5345299%2010.9334248%2C12.4257765%2014'
291 .
'.1024472%2C12.4257765%20C17.2714696%2C12.4257765%2019.8453876%2C13.5334163%2019.8453876%2C14'
292 .
'.9001487%20C19.8453876%2C16.2668812%2017.2751206%2C15.9316939%2014.1024472%2C15.9316939%20Z%20M11'
293 .
'.477416%2C13.4487843%20C11.0249669%2C13.5328062%2010.7150974%2C13.9604811%2010.7703097%2C14'
294 .
'.4247164%20C10.825522%2C14.8889517%2011.2267231%2C15.229209%2011.6858298%2C15.201166%20C12'
295 .
'.1449365%2C15.1731231%2012.5031841%2C14.7864774%2012.5033322%2C14.3188606%20C12.4520761%2C13'
296 .
'.7928552%2011.9955831%2C13.4057049%2011.477416%2C13.4487843%20Z%20M16.0191544%2C14.4269902%20C16'
297 .
'.0754002%2C14.8911461%2016.4771659%2C15.230674%2016.9362856%2C15.2020479%20C17.3954053%2C15'
298 .
'.1734219%2017.7533545%2C14.7865259%2017.7533947%2C14.3188606%20C17.7021533%2C13.7912874%2017'
299 .
'.2433569%2C13.4035634%2016.7238275%2C13.4487843%20C16.2716033%2C13.5343137%2015.9629087%2C13'
300 .
'.9628342%2016.0191544%2C14.4269902%20Z%22%2F%3E%0A%20%20%3C%2Fg%3E%0A%3C%2Fsvg%3E%0A'
303 $imBot = Bot::getCache($bot->getId());
308 'BACKGROUND_ID' => (
new Background($chatId))->
get(),
312 'APP_ID' => $imBot[
'APP_ID'] ??
null,
313 'BOT_ID' => $imBot[
'BOT_ID'] ??
null,
314 'CODE' => $imBot[
'CODE'] ??
null,
315 'HIDDEN' => $imBot[
'HIDDEN'] ??
null,
316 'LANG' => $imBot[
'LANG'] ??
null,
317 'MODULE_ID' => $imBot[
'MODULE_ID'] ??
null,
318 'OPENLINE' => $imBot[
'OPENLINE'] ??
null,
319 'TYPE' => $imBot[
'TYPE'] ??
null,
320 'VERIFIED' => $imBot[
'VERIFIED'] ??
null,
324 if ($bot->getId() !==
null)
329 $customData[
'imUser'][
'BOT_DATA'] = (!empty($botData)) ? $botData :
null;
331 $avatar = Helper\User::makeAvatar($bot);
334 if ($customData[
'imUser'][
'COLOR'] !==
'')
336 $avatar = str_replace(
338 explode(
'#', $customData[
'imUser'][
'COLOR'])[1],
344 $avatar = $defaultIcon;
349 'id' => $bot->getId(),
350 'entityId' =>
'im-bot',
351 'entityType' => Bot::getListForJs()[$bot->getId()][
'type'],
354 'customData' => $customData,
365 if (!$this->
getOption(
'fillDialogWithDefaultValues',
true))
368 $recentItems = $dialog->
getRecentItems()->getEntityItems(
'im-bot');
369 $recentIds = array_map(
'intval', array_keys($recentItems));
377 $maxBotsInRecentTab = 50;
381 'order' => [
'ID' =>
'DESC'],
382 'limit' => $maxBotsInRecentTab
385 if (
count($preloadedBots) < $maxBotsInRecentTab)
391 $entity->setDynamicSearch(
false);
398 $recentItems = $dialog->
getRecentItems()->getEntityItems(
'im-bot');
399 $recentIds = array_map(
'intval', array_keys($recentItems));
400 $this->fillRecentBots($recentBots, $recentIds, $preloadedBots);
403 if (
count($recentBots) < $maxBotsInRecentTab)
406 $recentGlobalIds = [];
408 if (!empty($recentGlobalItems))
410 $recentGlobalIds = array_map(
'intval', array_keys($recentGlobalItems));
411 $recentGlobalIds = array_values(array_diff($recentGlobalIds, $recentBots->getIdList()));
412 $recentGlobalIds = array_slice($recentGlobalIds, 0, $maxBotsInRecentTab - $recentBots->count());
415 $this->fillRecentBots($recentBots, $recentGlobalIds, $preloadedBots);
419 foreach ($preloadedBots as $preloadedBot)
421 $recentBots->add($preloadedBot);