diff --git a/Music-Bot.py b/Music-Bot.py index 22ad30f..b21b0c3 100644 --- a/Music-Bot.py +++ b/Music-Bot.py @@ -218,10 +218,11 @@ else: @bot.slash_command() async def youtube(ctx, *, search: str): + url = await youtube_search(search=search) async with ctx.typing(): await ctx.respond("🤖 Your song is queued for download... please wait ", ephemeral=True) try: - player = await YTDLSource.from_url(youtube_search(search=search), loop=bot.loop) + player = await YTDLSource.from_url(url, loop=bot.loop) ctx.voice_client.play( player, after=lambda e: print(f"Player error: {e}") if e else None )