Метод ensureDiscussReportCommand

private static

Сигнатура метода

private static function ensureDiscussReportCommand(): void

Возвращает: void

Описание

Ensures the single module-wide "discuss report" slash command that backs the keyboard button for every bizproc bot. It is registered once as COMMON with BOT_ID=0, so \Bitrix\Im\Command::findCommands() dispatches it by name regardless of which bot's chat the button lives in — one global row therefore covers all agents, including copies released before this feature, without an updater. A per-bot row would instead grow the globally cached command list linearly with the number of agents and clear that hot cache on every single registration. HIDDEN keeps it out of the slash-command palette (it is only ever reached via the button). Idempotent and cache-safe on repeat: the in-process guard short-circuits after the first call, and Command::register() itself returns the existing id without clearing the command cache when a bizproc command with this name already exists.

Расположение

Исходный файл метода в Bitrix Framework

Путь к исходному файлу Source
~/bitrix/modulesbizproc/lib/integration/imbot/bizprocbot.php
Расположение метода в файле
Строки 290–319

Исходный код

PHP