From 8ae7a30d0b4df8b6833bc754aaadbea8d75130ef Mon Sep 17 00:00:00 2001 From: Khoo Hao Yit <40757009+KhooHaoYit@users.noreply.github.com> Date: Sun, 18 Aug 2019 01:33:03 +0800 Subject: [PATCH] fix(Message): delete method caused messageDelete event to fire twice (#3252) * ref: add getPayload and use for other get* methods * return existing data.* * use Action.getUser() * Fix messageDelete double emission --- src/structures/Message.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/structures/Message.js b/src/structures/Message.js index 8e5f423ab..99c006b7f 100644 --- a/src/structures/Message.js +++ b/src/structures/Message.js @@ -454,11 +454,7 @@ class Message extends Base { */ delete({ timeout = 0, reason } = {}) { if (timeout <= 0) { - return this.channel.messages.remove(this.id, reason).then(() => - this.client.actions.MessageDelete.handle({ - id: this.id, - channel_id: this.channel.id, - }).message); + return this.channel.messages.remove(this.id, reason).then(() => this); } else { return new Promise(resolve => { this.client.setTimeout(() => {