Add search variants
This commit is contained in:
@@ -3,6 +3,9 @@ from aiogram import Router, F
|
||||
from aiogram.types import InlineQuery
|
||||
|
||||
from bot.results.deezer import get_deezer_search_results
|
||||
from bot.results.soundcloud import get_soundcloud_search_results
|
||||
from bot.results.youtube import get_youtube_search_results
|
||||
from bot.results.spotify import get_spotify_search_results
|
||||
|
||||
from bot.modules.settings import UserSettings
|
||||
|
||||
@@ -12,7 +15,12 @@ router = Router()
|
||||
@router.inline_query(F.query != '')
|
||||
async def default_inline_query(inline_query: InlineQuery, settings: UserSettings):
|
||||
await inline_query.answer(
|
||||
await get_deezer_search_results(inline_query.query, settings),
|
||||
await {
|
||||
'd': get_deezer_search_results,
|
||||
'c': get_soundcloud_search_results,
|
||||
'y': get_youtube_search_results,
|
||||
's': get_spotify_search_results
|
||||
}[settings['default_search_provider'].value](inline_query.query, settings),
|
||||
cache_time=0,
|
||||
is_personal=True
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user