From a55c45ef94e0c2140dfbc5189d81d92029f1e744 Mon Sep 17 00:00:00 2001 From: nickpons666 Date: Thu, 19 Feb 2026 16:09:26 -0600 Subject: [PATCH] Fix: Ignorar GIFs y attachments puros sin texto en Discord MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Agregar validación temprana para ignorar mensajes vacíos en Discord - Si el mensaje solo contiene attachments (GIF, imagen, etc) sin texto, se ignora - Evita que se generen botones de traducción para GIFs puros Cambio en EVENT::MESSAGE_CREATE: - Verificar if (empty(trim($content))) y retornar antes de procesar --- discord_bot.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/discord_bot.php b/discord_bot.php index 4265496..e9db2e9 100755 --- a/discord_bot.php +++ b/discord_bot.php @@ -76,6 +76,11 @@ $discord->on(Event::MESSAGE_CREATE, function (Message $message, Discord $discord sendDiscordWelcomeMessageOnMessage($pdo, $message, $username); } + // Ignorar si es solo contenido vacío sin texto (solo attachments/GIFs/imágenes) + if (empty(trim($content))) { + return; + } + if (str_starts_with($content, '#')) { $command = ltrim($content, '#'); handleTemplateCommand($pdo, $message, $command);