Add changing preview type when searching track

This commit is contained in:
BarsTiger
2023-11-07 18:45:41 +02:00
parent 06c327933f
commit e99ba9daa3
12 changed files with 54 additions and 23 deletions

View File

@@ -4,14 +4,19 @@ from aiogram.types import InlineQuery
from bot.results.spotify import get_spotify_search_results
from bot.filters import ServiceSearchFilter
from bot.modules.settings import UserSettings
router = Router()
@router.inline_query(ServiceSearchFilter('s'))
async def search_spotify_inline_query(inline_query: InlineQuery):
async def search_spotify_inline_query(
inline_query: InlineQuery,
settings: UserSettings
):
await inline_query.answer(
await get_spotify_search_results(inline_query.query.removeprefix('s:')),
await get_spotify_search_results(inline_query.query.removeprefix('s:'),
settings),
cache_time=0,
is_personal=True
)