Closed engels74 closed 1 month ago
This pull request introduces significant enhancements to the bot's configuration management and update tracking functionalities. Key changes include the addition of a new FIXED_UPDATE_TIME
configuration option, improved error handling for time format validation, and refined logging for configuration updates. The Commands
class in bot/commands.py
has been updated to handle this new configuration, while the UpdateTracker
class in bot/update_tracker.py
now incorporates logic for managing fixed update times. Additionally, localization files have been updated to reflect these changes, ensuring users receive clear feedback regarding configuration status.
File | Change Summary |
---|---|
bot/commands.py |
- Enhanced config_command method to validate FIXED_UPDATE_TIME format. - Adjusted handling of value variable and refined response message construction. - Added error handling for message sending failures. - Added update_translations method. |
bot/update_tracker.py |
- Introduced get_fixed_update_time and get_fixed_update_time_str methods. - Updated load_tracker and update methods to manage last_update and next_update directly. - Modified calculate_next_update to incorporate fixed update time logic. |
config/config.py |
- Changed default CONFIG_DIR to /config . - Added format_time_value and parse_time functions. - Updated load_config , save_config , and update_config methods to handle new parameters. - Refactored logic for clarity and maintainability. |
config/config.yml.sample |
- Added FIXED_UPDATE_TIME: "XX:XX" configuration option. |
i18n/da.yml |
- Updated localization for FIXED_UPDATE_TIME in configuration and error messages. - Added new messages for invalid time formats and configuration updates. |
i18n/en.yml |
- Similar updates as in i18n/da.yml , with new keys for configuration and error handling related to FIXED_UPDATE_TIME . |
main.py |
- Adjusted schedule_updates function to check updates every 60 seconds. - Updated log function for timestamp formatting. - Modified update_translations to ensure global updates. - Changed contact email in comments. |
requirements.txt |
- Removed and re-added requests library, reflecting a change in the order of dependencies. |
bot/commands.py
regarding the restructuring of response message generation in the config_command
function are related to the main PR, which also modifies the response message construction for the FIXED_UPDATE_TIME
key.🐰 In the meadow where bunnies play,
New configs brighten up the day!
With time set right, no more delay,
Hop along, let's cheer and say,
"Fixed updates here, hip-hip-hooray!"
🌼✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Feat: Adding a new variable,
FIXED_UPDATE_TIME
A lot of changes to the
config.py
as well. Should handle editing theconfig.yml
on the fly a bit better, so users won't have to edit their config.yml with new values added over time. Hopefully it'll work, tested it somewhat thoroughly.Summary by CodeRabbit
Release Notes
New Features
FIXED_UPDATE_TIME
, allowing users to set a fixed update time in HH:MM format.Commands
class to include improved validation and error handling for configuration commands.Improvements
Localization