Update BotService.php
This commit is contained in:
@@ -226,8 +226,16 @@ class BotService {
|
|||||||
|
|
||||||
// Si el bot está pausado por bot_paused_until, no responder automáticamente
|
// Si el bot está pausado por bot_paused_until, no responder automáticamente
|
||||||
if (!empty($user['bot_paused_until']) && strtotime($user['bot_paused_until']) > time()) {
|
if (!empty($user['bot_paused_until']) && strtotime($user['bot_paused_until']) > time()) {
|
||||||
|
// Allow explicit navigation commands and numeric menu selection during pause (better UX)
|
||||||
|
$normalized = mb_strtolower(trim($messageText));
|
||||||
|
$isNav = in_array($normalized, ['menu','menú','inicio','atras','atrás','volver','back'], true) || is_numeric(trim($messageText));
|
||||||
|
if ($isNav) {
|
||||||
|
try { error_log("[BotService] processMessage - bot_paused_until active but allowing navigation input for phone={$phoneNumber} message='{$messageText}'"); } catch (Throwable $t) {}
|
||||||
|
// proceed to let navigation/menus be processed
|
||||||
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Si el usuario ha desactivado el bot manualmente (toggle), no responder
|
// Si el usuario ha desactivado el bot manualmente (toggle), no responder
|
||||||
if (isset($user['bot_enabled']) && !$user['bot_enabled']) {
|
if (isset($user['bot_enabled']) && !$user['bot_enabled']) {
|
||||||
|
|||||||
Reference in New Issue
Block a user