title: discord.js ( bot ) Error : TypeError: connection.playFile is not a function
body: <p>I don't understand why have this error:</p>
  
  <blockquote>
    <p>TypeError: connection.playFile is not a function</p>
  </blockquote>
  
  <p>My code : </p>
  
  <pre><code>if (message.member.voice.channel) {
  
    message.member.voice.channel.join()
    .then(connection =&gt; { 
      const dispatcher = connection.playFile(require("path").join(__dirname, './audio.mp3'));
  
      dispatcher.on('start', () =&gt; { //not working
          dispatcher.setVolume(0.70);
          console.log("Playing");
      }); 
      dispatcher.on('error', (err) =&gt; console.log(err)); //no errors
  
          dispatcher.on('end', end =&gt; { //working fine
              console.log("Finished");
              console.log("End: " + end);
              message.member.voiceChannel.leave()
          });
    });
    }
  </code></pre>