forked from FOSS/ASF-Control-Bot
feat(bot): add bot account ownership and balance
This commit is contained in:
@@ -111,11 +111,12 @@ async def redeem_single_bot_keys(bot_name: str, keys: list[str]) -> str:
|
||||
return text[:4000] + ("\n\n...обрезано" if len(text) > 4000 else "")
|
||||
|
||||
|
||||
async def redeem_all_bots_keys(keys: list[str]) -> str:
|
||||
async def redeem_all_bots_keys(keys: list[str], allowed_bots: list[str] | None = None) -> str:
|
||||
logger.info("Начата активация ключей по всем ботам: count=%s", len(keys))
|
||||
response = get_all_bots()
|
||||
data = response.json()
|
||||
bots = list(data.get("Result", {}).keys())
|
||||
available = list(data.get("Result", {}).keys())
|
||||
bots = [name for name in available if allowed_bots is None or name in allowed_bots]
|
||||
logger.info("Для массовой активации найдено ботов: count=%s", len(bots))
|
||||
success_count = 0
|
||||
failed_count = 0
|
||||
|
||||
Reference in New Issue
Block a user