Clean up codebase and add documentation

- Remove all comments from Python source files for cleaner code
- Add comprehensive README.md with installation and usage instructions
- Add .gitignore to exclude runtime files and sensitive configuration
- Preserve all functionality while improving code readability
This commit is contained in:
2025-09-22 18:10:21 +01:00
parent ba7f082d5c
commit 9285b1b29d
15 changed files with 294 additions and 244 deletions

View File

@@ -1,4 +1,3 @@
#!/usr/bin/env python3
"""
Utility functions for DuckHunt Bot
"""
@@ -15,7 +14,6 @@ class InputValidator:
"""Validate IRC nickname format"""
if not nick or len(nick) > 30:
return False
# RFC 2812 nickname pattern
pattern = r'^[a-zA-Z\[\]\\`_^{|}][a-zA-Z0-9\[\]\\`_^{|}\-]*$'
return bool(re.match(pattern, nick))
@@ -44,9 +42,8 @@ class InputValidator:
"""Sanitize user input message"""
if not message:
return ""
# Remove control characters and limit length
sanitized = ''.join(char for char in message if ord(char) >= 32 or char in '\t\n')
return sanitized[:500] # Limit message length
return sanitized[:500]
def parse_message(line):