diff --git a/src/structures/interfaces/Collector.js b/src/structures/interfaces/Collector.js index 969b3d2c38a4..e87453853df7 100644 --- a/src/structures/interfaces/Collector.js +++ b/src/structures/interfaces/Collector.js @@ -1,6 +1,7 @@ 'use strict'; const EventEmitter = require('events'); +const { TypeError } = require('../../errors'); const Collection = require('../../util/Collection'); const Util = require('../../util/Util'); @@ -74,6 +75,10 @@ class Collector extends EventEmitter { */ this._idletimeout = null; + if (typeof filter !== 'function') { + throw new TypeError('INVALID_TYPE', 'filter', 'function'); + } + this.handleCollect = this.handleCollect.bind(this); this.handleDispose = this.handleDispose.bind(this);