So I want to play local files in my discord voice channel, right now it joins the voice channel but it does not play anything. This is the code:
if message.content.startswith('$Hest'):
where = message.content.split(" ")[1]
channel = get(message.guild.channels, name=where)
voicechannel = await channel.connect()
voicechannel.play(discord.FFempegPCMAudio(executable='D:/ffmpeg/ffmpeg/bin/ffplay.exe', source='D:/ffmpeg/Horse.mp3'))
And this is my output when I try to do it
Traceback (most recent call last):
File "F:\Apanda\CustomMultiPyBot\venv\lib\site-packages\discord\client.py", line 343, in _run_event
await coro(*args, **kwargs)
File "F:/Apanda/CustomMultiPyBot/main.py", line 41, in on_message
voicechannel.play(discord.FFempegPCMAudio(executable='D:/ffmpeg/ffmpeg/bin/ffplay.exe', source='D:/ffmpeg/Horse.mp3'))
AttributeError: module 'discord' has no attribute 'FFempegPCMAudio'
discord.ext.commands
framework rather than usingmessage.content.startswith()
, as it is generally better practice. – Jacob Lee