mirror of
https://github.com/danbulant/discord.js
synced 2026-05-27 22:11:53 +00: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:
parent
ab27dd0218
commit
8ae7a30d0b
1 changed files with 1 additions and 5 deletions
|
|
@ -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(() => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue