title: Discord.py music bot program
body: <p>I am trying to write a discord music bot, but after hours of search and different tutorials, I cannot get it to work. Here is my code so far:</p>
  <pre class="lang-py prettyprint-override"><code>import discord
  from discord.ext import commands
  import os
  
  client = commands.Bot(command_prefix=&quot;!&quot;)
  
  @client.command()
  async def music(ctx):
    
      voice = discord.utils.get(client.voice_clients, guild=ctx.guild)
  
      voiceChannel = discord.utils.get(ctx.guild.voice_channels, name='Music')
  
      await voiceChannel.connect()
      await voice.connect()
    
      voice.play(discord.FFmpegPCMAudio(&quot;song.mp3&quot;))
  
  
  client.run('TOKEN')
  </code></pre>
  <p>When I run the bot, it joins the Voice Channel, but does not play any music</p>
  <p>I have tried lots of things and it won't work. I heard it has something to do with <code>discord.utils.get(client.voice_clients, guild=ctx.guild)</code>, but I can't seem to find an alternative.</p>
  <p>(I know there are answers online, but they don't work for me)</p>
  <p>Please Help,</p>
  <p>Thanks, Haniel</p>