Hello i want to refactor my current embed pagination. How do I update the embed in a separate button handler? A user starts a slashcommand where I create n embeds where n: n >= 1. the customId of the two buttons are in this format
RESERVATION-NEXT-' /*spotId*/
RESERVATION-NEXT-' /*spotId*/
,
RESERVATION-BACK-' /*spotId*/
RESERVATION-BACK-' /*spotId*/
, In my button handler (interactionCreate.ts) i dont know how I access the embeds from my slashcommand which I have created to edit the current embed
} else if (interaction.isButton()) { const button = interaction.client.buttons.get(interaction.customId); if (!button) { if (interaction.customId.startsWith('RESERVATION-NEXT-' /*spotId*/) && interaction.customId.split('-').length === 3) { return await handleSpotNextButton(interaction); } if (interaction.customId.startsWith('RESERVATION-BACK-' /*spotId*/) && interaction.customId.split('-').length === 3) { return await handleSpotBackButton(interaction); } console.error(`No interaction matching ${interaction.customId} was found.`); return; } try { if (!button.execute) return; button.execute(interaction, userState); } catch (error) { console.error(error); }
} else if (interaction.isButton()) { const button = interaction.client.buttons.get(interaction.customId); if (!button) { if (interaction.customId.startsWith('RESERVATION-NEXT-' /*spotId*/) && interaction.customId.split('-').length === 3) { return await handleSpotNextButton(interaction); } if (interaction.customId.startsWith('RESERVATION-BACK-' /*spotId*/) && interaction.customId.split('-').length === 3) { return await handleSpotBackButton(interaction); } console.error(`No interaction matching ${interaction.customId} was found.`); return; } try { if (!button.execute) return; button.execute(interaction, userState); } catch (error) { console.error(error); }