Description
Three minor code quality issues identified during review:
1. Duplicate unreachable return self.login() — auth/twitch_auth.py
get_token() contains a second return self.login() that is never reached. Likely a merge artefact.
Fix: Remove the duplicate line.
2. print() instead of logging in event_error — bot/bot.py
async def event_error(self, error: Exception, data: str | None = None) -> None:
print(f"Error: {error}")
print() has no severity level, no timestamp, and cannot be filtered or redirected. Error details may contain sensitive information.
Fix:
import logging
_log = logging.getLogger(__name__)
async def event_error(self, error: Exception, data: str | None = None) -> None:
_log.error("TwitchIO error: %s", error)
Fix: Add at the top of the solution command handler:
if self._game_state.is_found:
await ctx.send(f"The game is already over. The word was '{self._game_state.target_word}'.")
return
Identified by
🔍 [Tech] Reviewer
Description
Three minor code quality issues identified during review:
1. Duplicate unreachable
return self.login()—auth/twitch_auth.pyget_token()contains a secondreturn self.login()that is never reached. Likely a merge artefact.Fix: Remove the duplicate line.
2.
print()instead oflogginginevent_error—bot/bot.pyprint()has no severity level, no timestamp, and cannot be filtered or redirected. Error details may contain sensitive information.Fix:
Fix: Add at the top of the
solutioncommand handler:Identified by
🔍
[Tech] Reviewer