From b2abece09752f526744cdf8c95f17dd58f698ca6 Mon Sep 17 00:00:00 2001 From: Lizandro Guarnizo <77708265+lizandrogd@users.noreply.github.com> Date: Mon, 29 Jun 2026 11:25:15 -0500 Subject: [PATCH] fix: per-type commands extend globals instead of replacing them MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- services/NormalBot.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/NormalBot.php b/services/NormalBot.php index 243b365..d2cc189 100644 --- a/services/NormalBot.php +++ b/services/NormalBot.php @@ -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'] ?? []);