diff --git a/src/duckhuntbot.py b/src/duckhuntbot.py index d5230e7..4de1d8c 100644 --- a/src/duckhuntbot.py +++ b/src/duckhuntbot.py @@ -347,7 +347,9 @@ class DuckHuntBot: # Sanitize target and message safe_target = sanitize_user_input(target, max_length=100, allowed_chars='#&+!abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-[]{}^`|\\') - safe_msg = sanitize_user_input(msg, max_length=400) + # Sanitize message (preserve IRC formatting codes - only remove CR/LF) + safe_msg = msg[:400] if isinstance(msg, str) else str(msg)[:400] + safe_msg = safe_msg.replace('\r', '').replace('\n', ' ').strip() if not safe_target or not safe_msg: self.logger.warning(f"Empty target or message after sanitization")