mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
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
This commit is contained in:
@@ -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(() => {
|
||||
|
||||
Reference in New Issue
Block a user