title: bulkDelete function in discord.js deletes more than what it is supposed to delete
body: <p>Iam a newbie to js and i wanted to try and create a discord bot using discord.js</p>
  <p>I used the tutorial from youtube to do this code.
  This is the link of the video tutorial which helped me build this code (<a href="https://www.youtube.com/watch?v=INQgI-MQcj0" rel="nofollow noreferrer">https://www.youtube.com/watch?v=INQgI-MQcj0</a>)
  .This code deletes more than what its supposed to delete, idont know what went wrong.</p>
  <p>this is my code...</p>
  <pre><code>    module.exports = {
      name: 'clear',
      description: &quot;Clears the certain number of messsages.&quot;,
      async execute(message, args){
          if(!args[0]) return message.reply(&quot;Please enter the amount of messages that you want to clear!&quot;);
          if(isNaN(args[0])) return message.reply(&quot;Please enter real number!&quot;);
  
          if(args[0] &gt; 100) return message.reply(&quot;You cannnot delete more than 100 messages at a time!&quot;);
          if(args[0] &lt; 1) return message.reply(&quot;You must delete at least one message&quot;);
  
          await message.channel.messages.fetch({Limit: args[0]}).then(messages =&gt;{
              message.channel.bulkDelete(messages);
          });
        }
      }
  </code></pre>
  <p>This is the main fn</p>
  <pre><code>const Discord = require('discord.js');
  
  const client = new Discord.Client();
  
  const prefix = '-';
  
  const fs = require('fs');
  
  client.commands = new Discord.Collection();
  
  const commandFiles = fs.readdirSync('./commands/').filter(file =&gt; file.endsWith('.js'));
  for(const file of commandFiles){
      const command = require(`./commands/${file}`);
  
      client.commands.set(command.name, command);
  }
  
  client.once('ready', () =&gt; {
      console.log('Knight 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 === 'ping'){
          client.commands.get('ping').execute(message, args);
      }
      else if(command === 'hi'){
          client.commands.get('hi').execute(message, args);
      }
      else if(command === 'token'){
          client.commands.get('token').execute(message, args);
      }
      else if(command === 'hey'){
          client.commands.get('hey').execute(message, args);
      }
      else if(command === &quot;kick_permission&quot;){
          client.commands.get(&quot;kick_permission&quot;).execute(message, args);
      }
      else if(command === &quot;rules&quot;){
          client.commands.get(&quot;rules&quot;).execute(message, args, Discord);
      }
      else if(command === 'clear'){
          client.commands.get('clear').execute(message, args);
      }
      
  });
  
  client.login('token');
  </code></pre>
  <p>This is the error it gave after accidentally deleting the whole text channel.</p>
  <pre><code>(node:5876) UnhandledPromiseRejectionWarning: DiscordAPIError: You can only bulk delete messages that are under 14 days old.    at RequestHandler.execute (D:\DiscordBot\node_modules\discord.js\src\rest\RequestHandler.js:154:13)
      at processTicksAndRejections (internal/process/task_queues.js:93:5)
      at async RequestHandler.push (D:\DiscordBot\node_modules\discord.js\src\rest\RequestHandler.js:39:14)
      at async TextChannel.bulkDelete (D:\DiscordBot\node_modules\discord.js\src\structures\interfaces\TextBasedChannel.js:342:7)
  (Use `node --trace-warnings ...` to show where the warning was created)
  (node:5876) 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:5876) [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>Help me out please and Thanks :)</p>