Skip to content

Commit

Permalink
Update interactionEdit.js
Browse files Browse the repository at this point in the history
  • Loading branch information
devlordduck authored Nov 25, 2023
1 parent 6d2dcfc commit 5308398
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions src/functions/event/interactionEdit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ""] = data.inside.splits;
let [content = "", embeds = "", components = "", files = "", allowedMentions = "all"] = data.inside.splits;

const Checker = (theparts, name) => theparts.includes("{" + name + ":");

Expand All @@ -12,14 +12,20 @@ module.exports = async d => {

files = await d.util.parsers.parsers.FileParser.code(d, { part: files, Checker });

await d.data.interaction?.update({
content: content.trim() === "" ? " " : content.addBrackets(),
embeds: embeds,
components: components,
files
}).catch(e => {
allowedMentions = allowedMentions === "all" ? ["everyone", "users", "roles"] : allowedMentions?.split(",") || [];

await d.data.interaction?.editReply({
content: content.trim() === "" ? " " : content.addBrackets(),
embeds: embeds,
components: components,
files,
allowedMentions: {
parse: allowedMentions
}
}
).catch(e => {
d.aoiError.fnError(d, 'custom', {}, 'Failed To Reply With Reason: ' + e)
})
});

return {
code: d.util.setCode(data)
Expand Down

0 comments on commit 5308398

Please sign in to comment.