Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
cmyui opened this issue Feb 26, 2024 · 1 comment
Open

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

cmyui opened this issue Feb 26, 2024 · 1 comment
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@cmyui
Copy link
Member

cmyui commented Feb 26, 2024

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.

@cmyui cmyui added triage This issue or pull request needs sorting. bug Something isn't working good first issue Good for newcomers and removed triage This issue or pull request needs sorting. labels Feb 26, 2024
@minisbett
Copy link
Contributor

oh that's why it happens, have noticed that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants