Skip to content

Commit 29d7263

Browse files
authored
exclude players with provisional rating (#14)
1 parent 22f5fe3 commit 29d7263

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tops.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
async def top_chat(update: Update, context: ContextTypes.DEFAULT_TYPE):
77
# check if game mode is specified
8-
game_mode = 'classical'
8+
game_mode = 'blitz'
99
if len(context.args) > 0:
1010
game_mode = context.args[0].lower()
1111

@@ -24,9 +24,10 @@ async def top_chat(update: Update, context: ContextTypes.DEFAULT_TYPE):
2424

2525
if telegram_member.status not in ['left', 'kicked']:
2626
lichess_user = lichess.api.user(lichess_username)
27-
rating = lichess_user['perfs'][game_mode]['rating']
28-
if rating is not None:
29-
ratings[lichess_username] = rating
27+
if not 'prov' in lichess_user['perfs'][game_mode]:
28+
rating = lichess_user['perfs'][game_mode]['rating']
29+
if rating is not None:
30+
ratings[lichess_username] = rating
3031

3132
except Exception as e:
3233
print(f"Failed to retrieve {game_mode} rating for user {lichess_username}: {e}")

0 commit comments

Comments
 (0)