Archived
style: reformat handlers and UI for readability
This commit is contained in:
@@ -9,7 +9,9 @@ def is_bot_playing(bot_name: str) -> bool:
|
||||
return False
|
||||
data = response.json()
|
||||
bot = data.get("Result", {}).get(bot_name, {})
|
||||
return bool(bot.get("PlayingBlocked", False)) or bool(bot.get("CurrentGamesPlayed", []))
|
||||
return bool(bot.get("PlayingBlocked", False)) or bool(
|
||||
bot.get("CurrentGamesPlayed", [])
|
||||
)
|
||||
|
||||
|
||||
def is_idle_enabled(bot_name: str, app_id: int) -> bool:
|
||||
|
||||
@@ -92,7 +92,8 @@ async def render_inventory_page(
|
||||
text = (
|
||||
f"📦 {inv_name} Inventory {bot_name}\n"
|
||||
f"📄 Страница {page + 1}/{total_pages}\n\n"
|
||||
f"{stats}\n\n"
|
||||
+ "\n".join(lines)
|
||||
f"{stats}\n\n" + "\n".join(lines)
|
||||
)
|
||||
return text[:4000], inventory_page_keyboard(
|
||||
inventory_type, bot_name, page, total_pages
|
||||
)
|
||||
return text[:4000], inventory_page_keyboard(inventory_type, bot_name, page, total_pages)
|
||||
|
||||
@@ -69,8 +69,7 @@ async def redeem_single_bot_keys(bot_name: str, keys: list[str]) -> str:
|
||||
text = (
|
||||
f"Результат активации для <code>{bot_name}</code>\n\n"
|
||||
f"✅ Успешно: {success_count}\n"
|
||||
f"❌ Ошибок: {failed_count}\n\n"
|
||||
+ "\n".join(results[:50])
|
||||
f"❌ Ошибок: {failed_count}\n\n" + "\n".join(results[:50])
|
||||
)
|
||||
return text[:4000] + ("\n\n...обрезано" if len(text) > 4000 else "")
|
||||
|
||||
@@ -119,7 +118,6 @@ async def redeem_all_bots_keys(keys: list[str]) -> str:
|
||||
text = (
|
||||
"Результат активации\n\n"
|
||||
f"✅ Успешно: {success_count}\n"
|
||||
f"❌ Ошибок: {failed_count}\n\n"
|
||||
+ "\n".join(results[:50])
|
||||
f"❌ Ошибок: {failed_count}\n\n" + "\n".join(results[:50])
|
||||
)
|
||||
return text[:4000] + ("\n\n...обрезано" if len(text) > 4000 else "")
|
||||
|
||||
Reference in New Issue
Block a user