LOW: Move hardcoded user IDs and IP addresses to configuration #38
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Several hardcoded values are scattered throughout the codebase that should be configurable:
1. Hardcoded User ID in scheduled.py
In bot/utils/scheduled.py (around line 113), the user ID 214857593045254151 is hardcoded and always added to bedtime reminder targets regardless of which server is being processed. This means one specific user gets bedtime reminders from every server the bot is in, even if they are not a member.
2. Hardcoded IP addresses in uno_game.py
In bot/utils/uno_game.py (around line 22), the UNO server URLs are hardcoded:
These should be configurable via config.yaml or environment variables so the UNO server can be relocated without code changes.
3. Other potential hardcoded values
A broader audit may reveal additional hardcoded URLs, user IDs, or channel IDs. These should all be extracted to configuration.
Proposed Solution
Add to config.yaml:
scheduled:
bedtime_always_include_users: [214857593045254151]
uno:
api_url: http://192.168.1.2:5000
client_url: http://192.168.1.2:3002
Read these from the unified config system (see related issue on config unification)
Audit codebase for other hardcoded values:
grep -rn '192.168.' bot/
grep -rn '[0-9]{17,19}' bot/ (Discord snowflake IDs)
Impact
Files Affected