From a35fc553e01e7ece8a0e99b0b099877aef9eb478 Mon Sep 17 00:00:00 2001 From: RaZegame <75721601+RaZeSloth@users.noreply.github.com> Date: Mon, 20 Dec 2021 16:50:22 +0200 Subject: [PATCH 1/5] fix: Make the followUp function error more clear --- src/structures/interfaces/InteractionResponses.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/structures/interfaces/InteractionResponses.js b/src/structures/interfaces/InteractionResponses.js index 85026e9beae5..3e9d8494c6f8 100644 --- a/src/structures/interfaces/InteractionResponses.js +++ b/src/structures/interfaces/InteractionResponses.js @@ -162,6 +162,7 @@ class InteractionResponses { * @returns {Promise} */ followUp(options) { + if(!this.deferred && !this.replied) throw new Error("NO_INTERACTION_TO_FOLLOWUP"); return this.webhook.send(options); } From f6de68bfd7a3fcd140a67a6ca35935710f93436f Mon Sep 17 00:00:00 2001 From: RaZe <75721601+RaZeSloth@users.noreply.github.com> Date: Mon, 20 Dec 2021 17:26:08 +0200 Subject: [PATCH 2/5] Update src/structures/interfaces/InteractionResponses.js Co-authored-by: D Trombett --- 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 3e9d8494c6f8..0386272e99e1 100644 --- a/src/structures/interfaces/InteractionResponses.js +++ b/src/structures/interfaces/InteractionResponses.js @@ -162,7 +162,7 @@ class InteractionResponses { * @returns {Promise} */ followUp(options) { - if(!this.deferred && !this.replied) throw new Error("NO_INTERACTION_TO_FOLLOWUP"); + if(!this.deferred && !this.replied) throw new Error("INTERACTION_NOT_REPLIED"); return this.webhook.send(options); } From 436bd3b4fe9f07d13b02151a8c38877fa65f99d2 Mon Sep 17 00:00:00 2001 From: RaZe <75721601+RaZeSloth@users.noreply.github.com> Date: Tue, 21 Dec 2021 13:40:15 +0200 Subject: [PATCH 3/5] Update src/structures/interfaces/InteractionResponses.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Antonio Román --- 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 0386272e99e1..1f5bb076f4e3 100644 --- a/src/structures/interfaces/InteractionResponses.js +++ b/src/structures/interfaces/InteractionResponses.js @@ -162,7 +162,7 @@ class InteractionResponses { * @returns {Promise} */ followUp(options) { - if(!this.deferred && !this.replied) throw new Error("INTERACTION_NOT_REPLIED"); + if (!this.deferred && !this.replied) throw new Error('INTERACTION_NOT_REPLIED'); return this.webhook.send(options); } From 9f251567bf51a4c3ee67891f5bac55adbcb883f0 Mon Sep 17 00:00:00 2001 From: RaZe Date: Tue, 21 Dec 2021 14:31:09 +0200 Subject: [PATCH 4/5] Made the function async --- 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 1f5bb076f4e3..8f244298ec5e 100644 --- a/src/structures/interfaces/InteractionResponses.js +++ b/src/structures/interfaces/InteractionResponses.js @@ -161,7 +161,7 @@ class InteractionResponses { * @param {string|MessagePayload|InteractionReplyOptions} options The options for the reply * @returns {Promise} */ - followUp(options) { + async followUp(options) { if (!this.deferred && !this.replied) throw new Error('INTERACTION_NOT_REPLIED'); return this.webhook.send(options); } From 3ff0c04b52ad82719230b304c9054ee7d342d68a Mon Sep 17 00:00:00 2001 From: RaZe <75721601+RaZeSloth@users.noreply.github.com> Date: Tue, 21 Dec 2021 15:56:25 +0200 Subject: [PATCH 5/5] Update src/structures/interfaces/InteractionResponses.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Antonio Román --- src/structures/interfaces/InteractionResponses.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/structures/interfaces/InteractionResponses.js b/src/structures/interfaces/InteractionResponses.js index 8f244298ec5e..dbe7c2327e8a 100644 --- a/src/structures/interfaces/InteractionResponses.js +++ b/src/structures/interfaces/InteractionResponses.js @@ -161,8 +161,8 @@ class InteractionResponses { * @param {string|MessagePayload|InteractionReplyOptions} options The options for the reply * @returns {Promise} */ - async followUp(options) { - if (!this.deferred && !this.replied) throw new Error('INTERACTION_NOT_REPLIED'); + followUp(options) { + if (!this.deferred && !this.replied) return Promise.reject(new Error('INTERACTION_NOT_REPLIED')); return this.webhook.send(options); }