Adds a new `@validate_id` decorator to validate `chat_id` and `user_id` parameters in `main.py`. This decorator ensures that all IDs passed to functions are in a valid format before making RPC calls to the Telegram API. It handles: - Integer IDs (positive and negative) - String representations of integer IDs - Usernames (e.g., "@username") - Lists of IDs Key changes: - Created a `validate_id` decorator in `main.py`. - Applied the decorator to all functions that accept `chat_id`, `user_id`, or similar parameters. - Updated the central `log_and_format_error` function to handle custom validation error messages and a specific `VALIDATION-001` error code for logging. - Added a new test suite (`test_validation.py`) with comprehensive tests for the decorator. - Updated `README.md` and `session_string_generator.py` with documentation about the new validation.
1 line
8 B
Text
1 line
8 B
Text
3.12.11
|