From 7f280dc918909e7b35c68cfabe50751a7799bc6b Mon Sep 17 00:00:00 2001 From: Pronin Egor <42776347+MrZillaGold@users.noreply.github.com> Date: Tue, 22 Jun 2021 03:19:52 +1000 Subject: [PATCH 1/5] fix(InteractionResponses): set replied status on editReply --- src/structures/interfaces/InteractionResponses.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/structures/interfaces/InteractionResponses.js b/src/structures/interfaces/InteractionResponses.js index 6ffd3fd82333..ce08ac739727 100644 --- a/src/structures/interfaces/InteractionResponses.js +++ b/src/structures/interfaces/InteractionResponses.js @@ -113,6 +113,8 @@ class InteractionResponses { * .catch(console.error); */ editReply(options) { + this.replied = true; + return this.webhook.editMessage('@original', options); } From f3d51ad4c8f7a9c1b1a6af4839fb4ce3a86fb9c2 Mon Sep 17 00:00:00 2001 From: Pronin Egor <42776347+MrZillaGold@users.noreply.github.com> Date: Tue, 22 Jun 2021 03:38:50 +1000 Subject: [PATCH 2/5] chore(InteractionResponses): check response resolve before changing field --- src/structures/interfaces/InteractionResponses.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/structures/interfaces/InteractionResponses.js b/src/structures/interfaces/InteractionResponses.js index ce08ac739727..a2493af81be2 100644 --- a/src/structures/interfaces/InteractionResponses.js +++ b/src/structures/interfaces/InteractionResponses.js @@ -113,9 +113,12 @@ class InteractionResponses { * .catch(console.error); */ editReply(options) { - this.replied = true; - - return this.webhook.editMessage('@original', options); + return this.webhook.editMessage('@original', options) + .then((message) => { + this.replied = true; + + return message; + }); } /** From 69623e01b925a20d293f26ee37bc9c49aae38c3e Mon Sep 17 00:00:00 2001 From: Pronin Egor <42776347+MrZillaGold@users.noreply.github.com> Date: Tue, 22 Jun 2021 19:50:48 +1000 Subject: [PATCH 3/5] chore(InteractionResponses): use async/await syntax --- src/structures/interfaces/InteractionResponses.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/structures/interfaces/InteractionResponses.js b/src/structures/interfaces/InteractionResponses.js index a2493af81be2..5721a230910e 100644 --- a/src/structures/interfaces/InteractionResponses.js +++ b/src/structures/interfaces/InteractionResponses.js @@ -112,13 +112,12 @@ class InteractionResponses { * .then(console.log) * .catch(console.error); */ - editReply(options) { - return this.webhook.editMessage('@original', options) - .then((message) => { - this.replied = true; - - return message; - }); + async editReply(options) { + const message = await this.webhook.editMessage('@original', options); + + this.replied = true; + + return message; } /** From f37580e76d2bb6c3e8038252730568963cc2d351 Mon Sep 17 00:00:00 2001 From: Pronin Egor <42776347+MrZillaGold@users.noreply.github.com> Date: Tue, 22 Jun 2021 19:57:29 +1000 Subject: [PATCH 4/5] style(InteractionResponses): remove paddings --- src/structures/interfaces/InteractionResponses.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/structures/interfaces/InteractionResponses.js b/src/structures/interfaces/InteractionResponses.js index 5721a230910e..bcb62f26a6f1 100644 --- a/src/structures/interfaces/InteractionResponses.js +++ b/src/structures/interfaces/InteractionResponses.js @@ -114,9 +114,7 @@ class InteractionResponses { */ async editReply(options) { const message = await this.webhook.editMessage('@original', options); - this.replied = true; - return message; } From 523fb55ac08a239711a788bcb0cd2a0dbac16470 Mon Sep 17 00:00:00 2001 From: Noel Date: Thu, 24 Jun 2021 00:06:13 +0100 Subject: [PATCH 5/5] Update InteractionResponses.js --- src/structures/interfaces/InteractionResponses.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/structures/interfaces/InteractionResponses.js b/src/structures/interfaces/InteractionResponses.js index 6096a44f40c2..4981b3551459 100644 --- a/src/structures/interfaces/InteractionResponses.js +++ b/src/structures/interfaces/InteractionResponses.js @@ -114,7 +114,7 @@ class InteractionResponses { * .then(console.log) * .catch(console.error); */ - editReply(options) { + async editReply(options) { if (!this.deferred && !this.replied) throw new Error('INTERACTION_NOT_REPLIED'); const message = await this.webhook.editMessage('@original', options); this.replied = true;