Reputation:
My current code to play music is as follows:
@bot.command()
async def play(ctx):
if not ctx.voice_client: # checks to make sure bot is not already in voice channel
audio_source = 'my_music.mp3'
voice_channel = ctx.message.author.voice.channel
ffmpeg = r'C:\Users\dmolp\PycharmProjects\DiscordBot\ffmpeg\ffmpeg\bin'
await voice_channel.connect()
voice_client = ctx.voice_client
voice_client.play(discord.FFmpegPCMAudio(executable=ffmpeg, source=audio_source))
The issue is whenever I run it and use the !play command the bot joins the voice channel just fine, but it does not play music and I get this error,
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: PermissionError: [WinError 5] Access is denied
I'm completely stumped on this one and any help is appreciated!
Upvotes: 1
Views: 547
Reputation: 34
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: PermissionError: [WinError 5] Access is denied
This error is thrown because your app is unable to Access. Check the documentation [Exceptions in module] for the solution. Solutions:
Upvotes: 1