Changelog for v2.2
General Changes
- Code Optimization: Updated several blocks for efficiency and better readability, especially in file handling and loop management.
- Consistency Improvements: Ensured consistent handling of logging, error reporting, and fallback mechanisms.
New Features
-
Improved Nitro Code Checking:
- Nitro codes are now filtered more efficiently for validity before processing.
- Added
new_codes
filtering logic to identify and process only untested codes. - Writes all updated codes to
tried-nitro-codes.txt
once after processing, reducing file I/O overhead.
-
Enhanced Giveaway Reaction Handling:
- Introduced logic to click the first available button in a giveaway message if present.
- Falls back to reacting with "🎉" only if button interaction fails or no button is available.
- Introduced a delay for "human-like" timing when handling reactions.
-
Giveaway Blacklist:
- Improved the handling of blacklisted words in both message content and embeds.
- Unified checking logic across embeds, including field values.
-
Event Management:
on_message
handles giveaways more effectively by checking blacklisted users and processing nitro codes or giveaways accordingly.- Added better exception handling during event execution.
Bug Fixes
- File Handling: Fixed a potential issue where
tried-nitro-codes.txt
could corrupt due to concurrent writes or incomplete data. - Rate Limiting: Improved rate-limited logging to avoid excessive log duplication during burst events.
- Error Handling: Enhanced error messages for failed Nitro code redemptions, including unexpected JSON structures and network issues.
Logging Enhancements
- Improved log formatting for better clarity.
- Added detailed error descriptions for debugging network issues, rate-limiting, and unexpected responses.
Documentation
- Expanded docstrings for better understanding of:
- Giveaway handling logic.
- Nitro code redemption processes.
- Configuration file structure and new settings.
Recommendations for Next Steps:
-
Testing:
- Validate the functionality in real-world scenarios to confirm improvements in Nitro code and giveaway handling.
- Test logging and rate-limiting under high-frequency events.
-
Future Improvements:
- Add more advanced logic for giveaway interactions, such as multiple button clicks or dropdowns.
- Implement asynchronous configuration reload to update settings without restarting the script.
Full Changelog: v2.1...v2.2