Улучшение обработки фильтров и полей в запросах к VNDB API

This commit is contained in:
2026-05-01 16:32:41 +03:00
parent c5ae63326f
commit d91c34efdf
2 changed files with 16 additions and 16 deletions

6
bot.py
View File

@@ -182,7 +182,7 @@ Staff: {stats.get('staff', 0)}
)
results = await vndb_client.query_vn(
filters=["search", "=", query], # ✔️ без вложенности
filters=["search", "=", query.strip().lower()], # ✔️ без вложенности
fields=["id", "title", "image{url}"],
results=10
)
@@ -228,7 +228,7 @@ Staff: {stats.get('staff', 0)}
return ConversationHandler.END
results = await vndb_client.query_character(
filters=["search", "=", query], # ✔️ важно
filters=["search", "=", query.strip().lower()], # ✔️ важно
fields=["id", "name", "image{url}"],
results=10
)
@@ -255,7 +255,7 @@ Staff: {stats.get('staff', 0)}
query = " ".join(context.args)
results = await vndb_client.query_release(
filters=["search", "=", query], # ✔️ важно
filters=["search", "=", query.strip().lower()], # ✔️ важно
fields=["id", "title"],
results=10
)