поменял ключ
This commit is contained in:
parent
05fc7c21ea
commit
9e79b97672
2 changed files with 10 additions and 2 deletions
|
|
@ -205,6 +205,10 @@ class LichessBot:
|
|||
ratings_data = await self.lichess_api.get_user_ratings(username)
|
||||
logger.debug(f"Received ratings for {username}: {ratings_data is not None}")
|
||||
|
||||
# Add delay between requests to avoid rate limiting
|
||||
if i < len(gamers) - 1: # Don't sleep after the last one
|
||||
await asyncio.sleep(0.5) # 500ms delay between requests
|
||||
|
||||
if ratings_data and 'perfs' in ratings_data:
|
||||
perfs = ratings_data['perfs']
|
||||
bullet_rating = perfs.get('bullet', {}).get('rating', 'N/A')
|
||||
|
|
@ -325,13 +329,17 @@ class LichessBot:
|
|||
text_lines = []
|
||||
keyboard = []
|
||||
|
||||
for gamer in gamers:
|
||||
for i, gamer in enumerate(gamers):
|
||||
status = "🟢" if gamer['is_active'] else "⚪"
|
||||
username = gamer['username']
|
||||
|
||||
# Get user ratings from Lichess API
|
||||
ratings_data = await self.lichess_api.get_user_ratings(username)
|
||||
|
||||
# Add delay between requests to avoid rate limiting
|
||||
if i < len(gamers) - 1: # Don't sleep after the last one
|
||||
await asyncio.sleep(0.5) # 500ms delay between requests
|
||||
|
||||
if ratings_data and 'perfs' in ratings_data:
|
||||
perfs = ratings_data['perfs']
|
||||
bullet_rating = perfs.get('bullet', {}).get('rating', 'N/A')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue