Forums

AttributeError: 'generator' object has no attribute 'start'

I am running a Discord bot via PythonAnywhere with Python 3.4. I am trying to get a music feature working so that the bot will play music in voice channels - however I am getting the following error:

AttributeError: 'generator' object has no attribute 'start'

I get this error when running:

voice = yield from client.join_voice_channel(channel)
player = yield from voice.create_ytdl_player("youtube link") # of course this is an actual YouTube link, not "youtube link".
player.start()

After searching the issue on Google, the only thing I could find is an issue on GitHub with a user saying that there may be something wrong with the ffmpeg installation. However, it is supposed to work with avconv and I believe PythonAnywhere already has this.

Here is a link to the docs I have been reading: http://discordpy.readthedocs.io/en/latest/api.html#discord.VoiceClient.create_ytdl_player

Does anyone know what the problem is or how it could be fixed?

Thank you.

"something wrong with ffmpeg" is not much to go on and it may not even be the real issue. It looks to me like the error you're seeing is a more general one that is the result of failing to properly run create_ytdl_player. You may need to dive in deeper to what it's trying to do and where it's failing to work out what's actually going wrong.