File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 11'use strict' ;
22
33const BaseManager = require ( './BaseManager' ) ;
4+ const { TypeError } = require ( '../errors' ) ;
45const Message = require ( '../structures/Message' ) ;
56const Collection = require ( '../util/Collection' ) ;
67const LimitedCollection = require ( '../util/LimitedCollection' ) ;
@@ -120,9 +121,9 @@ class MessageManager extends BaseManager {
120121 */
121122 async delete ( message , reason ) {
122123 message = this . resolveID ( message ) ;
123- if ( message ) {
124- await this . client . api . channels ( this . channel . id ) . messages ( message ) . delete ( { reason } ) ;
125- }
124+ if ( ! message ) throw new TypeError ( 'INVALID_TYPE' , 'message' , 'MessageResolvable' ) ;
125+
126+ await this . client . api . channels ( this . channel . id ) . messages ( message ) . delete ( { reason } ) ;
126127 }
127128
128129 async _fetchId ( messageID , cache , force ) {
You can’t perform that action at this time.
0 commit comments