Did some refactor, add YouTube as search variant
This commit is contained in:
21
bot/results/deezer/search.py
Normal file
21
bot/results/deezer/search.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from aiogram.types import (
|
||||
InlineQueryResultDocument, InlineQueryResultCachedAudio
|
||||
)
|
||||
|
||||
from bot.modules.deezer import deezer
|
||||
from bot.modules.database import db
|
||||
|
||||
from ..common.search import get_common_search_result
|
||||
|
||||
|
||||
async def get_deezer_search_results(query: str) -> list[
|
||||
InlineQueryResultDocument | InlineQueryResultCachedAudio
|
||||
]:
|
||||
return [
|
||||
await get_common_search_result(
|
||||
audio=audio,
|
||||
db_table=db.deezer,
|
||||
service_id='deez'
|
||||
)
|
||||
for audio in await deezer.songs.search(query, limit=50)
|
||||
]
|
||||
Reference in New Issue
Block a user