22 lines
577 B
Python
22 lines
577 B
Python
from aiogram import Router
|
|
from aiogram.types import InlineQuery
|
|
|
|
from bot.filters import ServiceSearchFilter
|
|
from bot.modules.settings import UserSettings
|
|
from bot.results.spotify import get_spotify_search_results
|
|
|
|
router = Router()
|
|
|
|
|
|
@router.inline_query(ServiceSearchFilter("s"))
|
|
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:"), settings
|
|
),
|
|
cache_time=0,
|
|
is_personal=True,
|
|
)
|