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

Handle Faceit users without EU rank and/or ban properly #14

Open
rce opened this issue Dec 12, 2017 · 0 comments
Open

Handle Faceit users without EU rank and/or ban properly #14

rce opened this issue Dec 12, 2017 · 0 comments

Comments

@rce
Copy link

rce commented Dec 12, 2017

EU ranking will be None and it can't be compared with int which breaks generating the ranking list. The user in question is also banned ("registration_status": "banned" in JSON) which is probably the reason for missing rank.

Example API call:
https://api.faceit.com/api/nicknames/theKuzu

Example error from !top faceit:

Traceback (most recent call last):
  File "/home/lemon/src/run_lemon_bot.py", line 689, in on_message
    await handler(client, message, arg)
  File "/home/lemon/src/sqlcommands.py", line 536, in cmd_top
    toplist, amountofpeople = await get_faceit_leaderboard()
  File "/home/lemon/src/sqlcommands.py", line 592, in get_faceit_leaderboard
    toplist = sorted(toplist, key=lambda x: x[0])[:10]
TypeError: unorderable types: NoneType() < int()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant