I am working on a discord bot using the discord.py API. I am trying to make the bot join a voice channel and play an mp3 file that is in the same directory. It joins the voice channel but prints the error in the title before playing anything. I was wondering what was causing this error. Relevant code below:
@client.command()
async def playClip(ctx):
global voice
channel=ctx.message.author.voice.channel
voice= get(client.voice_clients, guild=ctx.guild)
if voice and voice.is_connected():
await voice.move_to(channel)
else:
voice= await channel.connect()
voice.play(discord.FFmpegPCMAudio("BravoSix.mp3"))
print("test")
await voice.disconnect()