Clean up Actions code (#591)

This commit is contained in:
Schuyler Cebulskie
2016-09-03 17:48:51 -04:00
committed by Amish Shah
parent 432c5ccc82
commit 59a5862f2d
22 changed files with 71 additions and 98 deletions

View File

@@ -13,6 +13,7 @@ class MessageDeleteBulkAction extends Action {
handle(data) {
const client = this.client;
const channel = client.channels.get(data.channel_id);
const ids = data.ids;
const messages = new Collection();
for (const id of ids) {
@@ -21,9 +22,8 @@ class MessageDeleteBulkAction extends Action {
messages.set(message.id, message);
}
}
if (messages.size > 0) {
client.emit(Constants.Events.MESSAGE_BULK_DELETE, messages);
}
if (messages.size > 0) client.emit(Constants.Events.MESSAGE_BULK_DELETE, messages);
return {
messages,
};