mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
refactor: make use of destructuring for Constants (#1942)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
const Collector = require('./interfaces/Collector');
|
||||
const { Events } = require('../util/Constants');
|
||||
|
||||
/**
|
||||
* @typedef {CollectorOptions} MessageCollectorOptions
|
||||
@@ -36,14 +37,14 @@ class MessageCollector extends Collector {
|
||||
for (const message of messages.values()) this.handleDispose(message);
|
||||
}).bind(this);
|
||||
|
||||
this.client.on('message', this.handleCollect);
|
||||
this.client.on('messageDelete', this.handleDispose);
|
||||
this.client.on('messageDeleteBulk', bulkDeleteListener);
|
||||
this.client.on(Events.MESSAGE_CREATE, this.handleCollect);
|
||||
this.client.on(Events.MESSAGE_DELETE, this.handleDispose);
|
||||
this.client.on(Events.MESSAGE_BULK_DELETE, bulkDeleteListener);
|
||||
|
||||
this.once('end', () => {
|
||||
this.client.removeListener('message', this.handleCollect);
|
||||
this.client.removeListener('messageDelete', this.handleDispose);
|
||||
this.client.removeListener('messageDeleteBulk', bulkDeleteListener);
|
||||
this.client.removeListener(Events.MESSAGE_CREATE, this.handleCollect);
|
||||
this.client.removeListener(Events.MESSAGE_DELETE, this.handleDispose);
|
||||
this.client.removeListener(Events.MESSAGE_BULK_DELETE, bulkDeleteListener);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user