Fix channel validation by saving activity tracking immediately

- Activity tracking now saves to database immediately when commands are processed
- This ensures validate_target_player can see recent activity for channel membership checks
This commit is contained in:
2025-09-26 19:24:45 +01:00
parent bf3cd48639
commit b1b1d4d65f

View File

@@ -344,6 +344,8 @@ class DuckHuntBot:
if channel.startswith('#'): # Only track for channel messages if channel.startswith('#'): # Only track for channel messages
player['last_activity_channel'] = channel player['last_activity_channel'] = channel
player['last_activity_time'] = time.time() player['last_activity_time'] = time.time()
# Save activity immediately to ensure validation works
self.db.players[nick.lower()] = player
# Check if player is ignored (unless it's an admin) # Check if player is ignored (unless it's an admin)
try: try: