Issue
In cog/games.py lines 31-43, the update_stats() method accepts a bot_user_id parameter but it is never passed from any call site:
def update_stats(self, user_id: int, result: str, game: str = "rps", bot_user_id: int = None):
if user_id is None or user_id == bot_user_id: # This guard never triggers
return
# ...
# Call sites ([lines 117-118](https://github.com/InvalidDavid/Usagi-Bot/blob/main/cog/games.py#L117-L118), [212-213](https://github.com/InvalidDavid/Usagi-Bot/blob/main/cog/games.py#L212-L213)):
self.db.update_stats(self.p1.id, p1_result, "rps") # No bot_user_id passed
Why This Is a Problem
The intended protection against counting bot-vs-human games is non-functional. The bot_user_id parameter is dead code.
How to Fix
Either:
- Remove the parameter if not needed (simpler)
- Pass it from call sites if you want the protection:
self.db.update_stats(self.p1.id, p1_result, "rps", bot_user_id=self.bot_user.id)
I recommend option 1 for simplicity since the current logic is broken anyway.
Severity
High - Dead parameter, potential stat corruption if bot games counted
Issue
In
cog/games.pylines 31-43, theupdate_stats()method accepts abot_user_idparameter but it is never passed from any call site:Why This Is a Problem
The intended protection against counting bot-vs-human games is non-functional. The
bot_user_idparameter is dead code.How to Fix
Either:
I recommend option 1 for simplicity since the current logic is broken anyway.
Severity
High - Dead parameter, potential stat corruption if bot games counted