Skip to content

Commit

Permalink
fix(MessageBulkDeleteAction): remove deleted messages from cache (#2046)
Browse files Browse the repository at this point in the history
Fixes #2036
  • Loading branch information
SpaceEEC authored and iCrawl committed Oct 22, 2017
1 parent 339bcfd commit 356778b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/client/actions/MessageDeleteBulk.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ class MessageDeleteBulkAction extends Action {
const messages = new Collection();
for (const id of ids) {
const message = channel.messages.get(id);
if (message) messages.set(message.id, message);
if (message) {
messages.set(message.id, message);
channel.messages.delete(id);
}
}

if (messages.size > 0) client.emit(Events.MESSAGE_BULK_DELETE, messages);
Expand Down

0 comments on commit 356778b

Please sign in to comment.