Added base jsonlike return for player

This commit is contained in:
bacon
2024-03-10 16:07:51 +03:00
parent 01db1c254d
commit 0c2fc80485
2 changed files with 83 additions and 9 deletions

View File

@@ -1,6 +1,8 @@
import disnake
from disnake import Option
from disnake.ext import commands
from lib import YandexPlayer
from lib.Logger import logger
@@ -13,13 +15,15 @@ class Testing(commands.Cog, name='Testing'):
logger.info(f'Cog {__name__.split(".")[1]} is ready!.')
@commands.slash_command(name='play', description='play audio test from yandex.music', options=[
Option(name='search', description='seach track/artist'),
Option(name='type', description='type of search',
choices=['all', 'artist', 'user', 'album', 'playlist', 'track', 'podcast', 'podcast_episode'])
Option(name='search',
description='seach track/artist',
required=True),
])
async def play(self, inter: disnake.ApplicationCommandInteraction, audio):
async def play(self, inter: disnake.ApplicationCommandInteraction, search: str):
# TODO add yandex_music player with queue, playlists
pass
result = YandexPlayer.search(search)
await inter.response.send_message(result, ephemeral=True)
def setup(bot): # an extension must have a setup function