• Модуль: imbot
  • Путь к файлу: ~/bitrix/modules/imbot/lib/bot/support24.php
  • Класс: BitrixImBotBotSupport24
  • Вызов: Support24::getMessage
static function getMessage(string $code, $supportLevel = null): ?string
{
	if (!$supportLevel)
	{
		$supportLevel = self::getSupportLevel();
	}
	$supportLevel = mb_strtolower($supportLevel);

	if (mb_substr($code, 0, 4) == 'DAY_')
	{
		$code = mb_substr($code, 4);
	}

	$optionCode = $supportLevel == self::SUPPORT_LEVEL_FREE ?
		self::OPTION_BOT_FREE_MESSAGES : self::OPTION_BOT_PAID_MESSAGES;

	static $messages = [];
	if (!isset($messages[$optionCode]))
	{
		$messages[$optionCode] = unserialize(
			Option::get('imbot', $optionCode, "a:0:{}"),
			['allowed_classes' => false]
		);
	}

	return isset($messages[$optionCode][$code]) ? $messages[$optionCode][$code] : '';
}