fix: per-type commands extend globals instead of replacing them

Changed commands merge from ?? (replace) to array_merge (extend) so that
per-type overrides for menu/inicio/volver are applied without losing the
global salir, exit, informes, info commands.

Also updated DB config per_type:
- Type 1 (subir info): menu/inicio/volver → recibir_info → submenu_subir
- Type 2 (descargar): menu/inicio/volver → descargar_informes → submenu_informes
- Type 3 (admin): menu → show_main_menu (inherits global)

Each category now lands on its own menu from the first message.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Lizandro Guarnizo
2026-06-29 11:25:15 -05:00
co-authored by Claude Sonnet 4.6
parent 21d30a0895
commit b2abece097
+2 -1
View File
@@ -9,7 +9,8 @@ class NormalBot
$permType = (string)($company['_permission_type'] ?? 1);
$perType = $config['per_type'][$permType] ?? [];
$commands = $perType['commands'] ?? $config['commands'] ?? [];
// Per-type commands EXTEND globals (not replace), so salir/exit/etc. always work.
$commands = array_merge($config['commands'] ?? [], $perType['commands'] ?? []);
$flows = array_merge($config['flows'] ?? [], $perType['flows'] ?? []);
$menus = array_merge($config['menus'] ?? [], $perType['menus'] ?? []);