Skip to content

Commit

Permalink
Update editButton.js
Browse files Browse the repository at this point in the history
  • Loading branch information
baka-aho authored Oct 25, 2023
1 parent 6c7077e commit a864344
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/functions/util/editButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ module.exports = async (d) => {
if (!channel) return d.aoiError.fnError(d, "channel", { inside: data.inside });
const message = await d.util.getMessage(channel, messageId);
if (!message) return d.aoiError.fnError(d, "message", { inside: data.inside });
if (!customId) return d.aoiError.fnError(d, "custom", { inside: data.inside }, "Empty customId was provided");
if (!customId) return d.aoiError.fnError(d, "custom", { inside }, "Empty customId was provided");
if (isNaN(index) || Number(index) < 1) d.aoiError.fnError(d, "custom", {inside}, "Invalid Index Provided In");
index = Number(index) - 1;
if (style) {
style = d.util.constants.ButtonStyleOptions[style] || Number(style);
if (style > 5 || style < 1) d.aoiError.fnError(d, "custom", { inside: data.inside }, "Invalid Style Provided In");
if (style > 5 || style < 1) d.aoiError.fnError(d, "custom", { inside }, "Invalid Style Provided In");
}
const components = message.components;
if (!components[index]) components[index] = { type: 1, components: [] };
Expand Down

0 comments on commit a864344

Please sign in to comment.