osuAkatsuki / bancho.py

An osu! server for the generic public, optimized for maintainability in modern python
https://akatsuki.gg
MIT License
201 stars 125 forks source link

bug: !top doesn't work with offline players #636

Open cmyui opened 4 months ago

cmyui commented 4 months ago

Code reference: https://github.com/osuAkatsuki/bancho.py/blob/more-sqlalchemy/app/commands.py#L358-L411

The problem is this line: player = app.state.sessions.players.get(name=ctx.args[1]). This only works for online users. Instead, it should be using the users repository to lookup the player from the database. There should be good examples around the codebase of using the users_repo to fetch_one user, by username or user id.

minisbett commented 4 months ago

oh that's why it happens, have noticed that