title: SyntaxError: Lexical declaration cannot appear in a single-statement context
body: <p>I am trying to make my first discord bot and I have run into an error that I just don't understand so if someone could please explain to me why this doesn't work.
  This is the code:</p>
  <pre class="lang-js prettyprint-override"><code>const Discord = require('discord.js');
  const ytdl = require(&quot;ytdl-core&quot;);
  const token = 'token';
  const prefix = '%';
  const client = new Discord.Client();
  
  client.once('ready', () =&gt; {
      console.log('stonks is online!');
  });
  
  client.on('message', message =&gt;{
      if(!message.content.startsWith(prefix) || message.author.bot) return;
  
      const args = message.content.slice(prefix.length).split(/ +/);
      const command = args.shift().toLowerCase();
  
      if(command === 'koji'){
          message.channel.send('kurac!');
      } else if (command == 'nastran'){
          message.channel.send('Alejandro Hkavsc Nastran je legenda!');
      } else if (command == 'egart'){
          message.channel.send('Egart je šved');
      } else if (command == 'play')
          let args = message.content.substring(prefix.length).split(&quot; &quot;);
  
          switch (args[0]) {
              case 'play':
                  function play(connection, message){
                    var server = servers[message.guild.id];
  
                    server.dispatcher = connection.play(ytdl(server.queue[0], {filter: &quot;audioonly&quot;}));
                    server.queue.shift();
  
                    server.dispatcher.on(&quot;end&quot;, function(){
                        if(server.queue[0]){
                            play(connection, message);
                        }else {
                            connection.disconnect();
                        }
                    });
                  }
  
              if(!args[1]){
                  message.channel.send(&quot;you need to provide a link&quot;);
                  return;
              }
  
              if(!message.member.voice.channel){
                  message.channel.send(&quot;you must be in a voice channel to play the bot&quot;);
                  return;
              }
  
              if(!servers[message.guild.id]) servers[message.guild.id] = {
                  queue: []
              }
  
              var server = servers[message.guild.id];
              server.queue.push(args[1]);
  
              if(!message.member.voice.connection) message.member.voiceChannel.join().then(function(connection){
                  play(connection, message);
              }) 
  
              break;
      }
  });
  
  client.login('token');
  </code></pre>