Added youtube_search method
This commit is contained in:
@@ -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
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user