'Command raised an exception: TypeError: a bytes-like object is required, not 'coroutine'
My companion and I are writing a discord bot to listen to music from Yandex.Music: Our GutHub project. We need to make the bot listen to music without downloading the track, that is, broadcast it. We were helped with this by giving this solution: view code. But unfortunately our knowledge is not enough to adapt this code to our bot. We tried to adapt it in the following way, but it did not help, because the error:
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: a bytes-like object is required, not 'coroutine'
Our code:
@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)
Please help us. We don't know what to do anymore
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
