A
A
Artyom2021-02-25 10:54:16
Python
Artyom, 2021-02-25 10:54:16

How to play music from YouTube discord.py stream?

@client.command()
@commands.has_permissions(administrator = True)
async def connect(ctx):
    if(ctx.author.voice):
        await ctx.author.voice.channel.connect()
        await ctx.send("Подключён")
    else:
        await ctx.send("Что-то пошло не так!")


There is no way I can embed playback of audio from a youtube stream into this command. I want the user not to specify a link, but the bot, on command, to launch the source specified by the link in the code.

In advance, I will say that I have ffmpeg and the youtube_dl library installed and imported into the project.

Thanks for any help!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question