From 05e53bdc8711afaee645582c75dd7a69e4ab5a52 Mon Sep 17 00:00:00 2001 From: AlberLC Date: Thu, 4 Jul 2024 04:05:02 +0200 Subject: [PATCH] Add SteamBot --- flanabot/bots/steam_bot.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flanabot/bots/steam_bot.py b/flanabot/bots/steam_bot.py index d819e64..308e59f 100644 --- a/flanabot/bots/steam_bot.py +++ b/flanabot/bots/steam_bot.py @@ -2,7 +2,6 @@ __all__ = ['SteamBot'] import asyncio import base64 -import itertools import os import random import re @@ -44,8 +43,9 @@ class SteamBot(MultiBot, ABC): app_ids: Iterable[str], session: aiohttp.ClientSession ) -> None: - for ids_batch_batch in itertools.batched( - itertools.batched(app_ids, constants.STEAM_IDS_BATCH), constants.STEAM_MAX_CONCURRENT_REQUESTS + for ids_batch_batch in flanautils.chunks( + flanautils.chunks(list(app_ids), constants.STEAM_IDS_BATCH), + constants.STEAM_MAX_CONCURRENT_REQUESTS ): gather_results = await asyncio.gather( *(self._get_app_data(session, ids_batch, steam_region.code) for ids_batch in ids_batch_batch)