title: YouTube query function not working for my js bot discord
body: <p>I need help with the query part in this</p>
  <pre class="lang-js prettyprint-override"><code>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();
   const query = command.slice(command.search(' '), command.search('-'));
   if (command === 'ping') {
    message.channel.send('pong!');
   } else if (command === 'joke') {
    message.channel.send('Your life');
   } else if (command === 'youtube') {
    message.channel.send('https://www.youtube.com/results?search_query=' + query);
    message.channel.send(query);
   } else if (command === 'commands') {
    message.channel.send('commands so far are +ping, +joke, +youtube, +commands');
   }
  });
  </code></pre>
  <p>the error is this</p>
  <pre><code>(node:15016) UnhandledPromiseRejectionWarning: DiscordAPIError: Cannot send an empty message
      at RequestHandler.execute (C:\Users\kalar\Desktop\JavaPr\JS_Bot\node_modules\discord.js\src\rest\RequestHandler.js:170:25)
      at processTicksAndRejections (internal/process/task_queues.js:97:5)
  (node:15016) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
  (node:15016) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
  </code></pre>
  <p>I did this before I changed and I would just send the YouTube link instead of a query which i'm trying to make.</p>
  <pre><code>else if (command === 'youtube') {
    message.channel.send('https://www.youtube.com/results?search_query=' + query);
  </code></pre>