mirror of
https://github.com/danbulant/discord.js
synced 2026-06-05 15:51:31 +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 } = {}) {
|
delete({ timeout = 0, reason } = {}) {
|
||||||
if (timeout <= 0) {
|
if (timeout <= 0) {
|
||||||
return this.channel.messages.remove(this.id, reason).then(() =>
|
return this.channel.messages.remove(this.id, reason).then(() => this);
|
||||||
this.client.actions.MessageDelete.handle({
|
|
||||||
id: this.id,
|
|
||||||
channel_id: this.channel.id,
|
|
||||||
}).message);
|
|
||||||
} else {
|
} else {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
this.client.setTimeout(() => {
|
this.client.setTimeout(() => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue