title: How to get audio clip to play entirely before disconnecting
body: <p>I have the bot joining and playing the audio but it doesn't seem to be consistent all the time. Sometimes it joins and plays starting halfway through. I'm assuming this has to do with the nature of async. Is there a way to ensure that the bot joins plays the audio then leaves in that order? My code is below</p>
  
  <pre><code>@bot.command(name='play_audio')
  async def play_audio(ctx):
      if ctx.message.author == client.user:
          return
  
      voice = await join(ctx)
      voice.play(discord.FFmpegPCMAudio(f"{os.path.dirname(os.path.abspath(__file__))}/audio.mp3"))
      await leave(ctx)
  
  
  @bot.command(name='j')
  async def join(ctx):
      if ctx.message.author == client.user:
          return
  
      channel = ctx.message.author.voice.channel
      voice = get(bot.voice_clients, guild=ctx.guild)
  
      if voice and voice.is_connected():
          await voice.move_to(channel)
      else:
          voice = await channel.connect()
          print(f"The bot has connected to {channel}\n")
  
      return voice
  
  
  @bot.command(name='l')
  async def leave(ctx):
      if ctx.message.author == client.user:
          return
  
      channel = ctx.message.author.voice.channel
      voice = get(bot.voice_clients, guild=ctx.guild)
  
      if voice and voice.is_connected():
          await voice.disconnect()
          print(f"The bot has left {channel}\n")
  
  bot.run(TOKEN)
  </code></pre>