mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-14 02:23: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 } = {}) {
|
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(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user