Answer the question
In order to leave comments, you need to log in
Command raised an exception: TypeError: a bytes-like object is required, not 'coroutine'. How to fix?
My partner and I are writing a discord bot to listen to music from Yandex.Music: Our GitHub project
We need to make the bot listen to music without downloading the track, that is, broadcast it. They helped us with this by providing this solution: View code
But, unfortunately, our knowledge is not enough to adapt this code to our bot. We tried to adapt it like this, but it didn't help because the error is:
Command raised an exception: TypeError: a bytes-like object is required, not 'coroutine'
@bot.command()
async def playGodProgramming(ctx):
channel = ctx.message.author.voice.channel
if not channel:
await ctx.send("Вы не подключены к голосовому чату :(")
return
voice = get(bot.voice_clients, guild=ctx.guild)
if voice and voice.is_connected():
await voice.move_to(channel)
else:
voice = await channel.connect()
url = extract_direct_link_to_track(37971706)
blob = get_track_as_blob_by_url(url)
get_memcached_track(blob)
source = FFmpegPCMAudio(blob.read()) #Error
player = voice.play(source)
#Все методы из кода были перенесены без изменений
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question