From 9cd25a9f64b9d5fa13d4df601f5d17f196fe5f3b Mon Sep 17 00:00:00 2001 From: ethann2004 <117716577+ethann2004@users.noreply.github.com> Date: Fri, 3 Nov 2023 17:20:13 -0700 Subject: [PATCH 1/3] Added "returnID" to interactionReply --- src/functions/event/interactionReply.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/functions/event/interactionReply.js b/src/functions/event/interactionReply.js index 099eaf2a1..f784ddc92 100644 --- a/src/functions/event/interactionReply.js +++ b/src/functions/event/interactionReply.js @@ -2,7 +2,7 @@ module.exports = async d => { const data = d.util.aoiFunc(d); if (data.err) return d.error(data.err); - let [content = "", embeds = "", components = "", files = "", allowedMentions = "all", ephemeral = "false"] = data.inside.splits + let [content = "", embeds = "", components = "", files = "", allowedMentions = "all", ephemeral = "false", returnID = "false"] = data.inside.splits embeds = await d.util.parsers.EmbedParser(embeds); @@ -23,6 +23,10 @@ module.exports = async d => { ephemeral: ephemeral === "true" || ephemeral === "true" }) + const i = await d.data.interaction?.fetchReply(); + + data.result = returnID === "true" ? i?.id : undefined; + return { code: d.util.setCode(data) } From a6e10c465d62c4b453a30defcfae0003cff7b150 Mon Sep 17 00:00:00 2001 From: ethann2004 <117716577+ethann2004@users.noreply.github.com> Date: Fri, 3 Nov 2023 17:22:25 -0700 Subject: [PATCH 2/3] Added "returnID" to interactionFollowUp --- src/functions/event/interactionFollowUp.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/functions/event/interactionFollowUp.js b/src/functions/event/interactionFollowUp.js index a1d16d297..9a785ff08 100644 --- a/src/functions/event/interactionFollowUp.js +++ b/src/functions/event/interactionFollowUp.js @@ -2,7 +2,7 @@ module.exports = async d => { const data = d.util.aoiFunc(d); if (data.err) return d.error(data.err); - let [content = "", embeds = "", components = "", files = "", ephemeral = "false"] = data.inside.splits + let [content = "", embeds = "", components = "", files = "", ephemeral = "false", returnID = "false"] = data.inside.splits embeds = await d.util.parsers.EmbedParser(embeds); @@ -20,7 +20,11 @@ module.exports = async d => { d.aoiError.fnError(d, 'custom', {}, 'Failed To Reply With Reason: ' + e) }) + const i = await d.data.interaction?.fetchReply(); + + data.result = returnID === "true" ? i?.id : undefined; + return { code: d.util.setCode(data) } -} \ No newline at end of file +} From 400a06ede18c10b848b3495828002a68aaf4fb5e Mon Sep 17 00:00:00 2001 From: ethann2004 <117716577+ethann2004@users.noreply.github.com> Date: Fri, 3 Nov 2023 17:42:38 -0700 Subject: [PATCH 3/3] Fixed an issue with returning same id --- src/functions/event/interactionFollowUp.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/functions/event/interactionFollowUp.js b/src/functions/event/interactionFollowUp.js index 9a785ff08..594485a3e 100644 --- a/src/functions/event/interactionFollowUp.js +++ b/src/functions/event/interactionFollowUp.js @@ -10,7 +10,7 @@ module.exports = async d => { files = await d.util.parsers.FileParser(files); - await d.data.interaction?.followUp({ + const i = await d.data.interaction?.followUp({ content: content.trim() === "" ? " " : content.addBrackets(), embeds: embeds, components: components, @@ -20,8 +20,6 @@ module.exports = async d => { d.aoiError.fnError(d, 'custom', {}, 'Failed To Reply With Reason: ' + e) }) - const i = await d.data.interaction?.fetchReply(); - data.result = returnID === "true" ? i?.id : undefined; return {