Skip to content

Commit

Permalink
remove unnecessary assert
Browse files Browse the repository at this point in the history
  • Loading branch information
TiltedToast committed Mar 15, 2024
1 parent 649d0a5 commit 4ccf62a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/helpers/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,14 +188,15 @@ export async function updateEmbed(options: UpdateEmbedOptions) {

const step = { [prevButtonId]: -1, [nextButtonId]: 1 }[interaction.customId];
if (!step) {
console.error(
`Prev: ${prevButtonId} | Next: ${nextButtonId} | CustomID: ${interaction.customId}`
);
return await interaction.reply({
content: `Invalid button for some reason. Something must've gone VERY wrong, please let my owner \`${OWNER_NAME}\` know about this if you can`,
ephemeral: true,
});
}

assert(step !== undefined, "Step must be defined");

const newEmbed = embedArray[(activeIndex + step + embedArray.length) % embedArray.length];

return await interaction.update({ embeds: [newEmbed.embed] });
Expand Down

0 comments on commit 4ccf62a

Please sign in to comment.