title: Discord.js delete function
body: <p>My issue is that I receive an error when trying to delete a message in Discord.</p>
  <pre class="lang-js prettyprint-override"><code>client.on('message', msg =&gt; {
  
      if(msg.content.startsWith(&quot;.del &quot;)) {
  
        msg.delete(1000); //Supposed to delete message
  
      }
  });
  </code></pre>
  <p>I receive this error:</p>
  <pre class="lang-none prettyprint-override"><code>C:\Users\---\Desktop\Test\node_modules\discord.js\src\structures\Message.js:501
      if (typeof options !== 'object') throw new TypeError('INVALID_TYPE', 'options', 'object', true);
                                       ^
  
  TypeError [INVALID_TYPE]: Supplied options is not an object.
      at Message.delete (C:\Users\---\Desktop\Test\node_modules\discord.js\src\structures\Message.js:501:44)
      at Client.&lt;anonymous&gt; (C:\Users\---\Desktop\Test\index.js:51:17)
      at Client.emit (events.js:310:20)
      at MessageCreateAction.handle (C:\Users\---\Desktop\Test\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
      at Object.module.exports [as MESSAGE_CREATE] (C:\Users\---\Desktop\Test\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
      at WebSocketManager.handlePacket (C:\Users\---\Desktop\Test\node_modules\discord.js\src\client\websocket\WebSocketManager.js:386:31)
      at WebSocketShard.onPacket (C:\Users\---\Desktop\Test\node_modules\discord.js\src\client\websocket\WebSocketShard.js:436:22)
      at WebSocketShard.onMessage (C:\Users\---\Desktop\Test\node_modules\discord.js\src\client\websocket\WebSocketShard.js:293:10)
      at WebSocket.onMessage (C:\Users\---\Desktop\Test\node_modules\ws\lib\event-target.js:120:16)
      at WebSocket.emit (events.js:310:20) {
    [Symbol(code)]: 'INVALID_TYPE'
  }
  </code></pre>
  <p>I have also tried <code>message.delete(1000)</code>, but I receive an error telling me that message is undefined.</p>
  <p>The program works when I remove the code attempting to delete the message.</p>