© 2026 Hedgehog Software, LLC
const { InteractionHandler, InteractionHandlerTypes } = require('@sapphire/framework'); const { ActionRowBuilder, ModalBuilder, TextInputBuilder, TextInputStyle } = require('discord.js'); module.exports = class CreateEmbed extends InteractionHandler { constructor(ctx, options) { super(ctx, { ...options, interactionHandlerType: InteractionHandlerTypes.Button }); }; async run(interaction, result) { await interaction.showModal(result); } async parse(interaction) { if (interaction.customId !== 'setupEmbedBtn') { console.log(interaction.customId) this.none(); } try { const modal = new ModalBuilder() .setCustomId('setupEmbedMdl') .setTitle('Setup Embed') const embedGeneratorInput = new TextInputBuilder() .setCustomId('embedGeneratorInput') .setLabel('Pase the json code here or the url') .setMaxLength(4000) .setStyle(TextInputStyle.Paragraph) .setRequired(true); const firstActionRow = new ActionRowBuilder() .addComponents(embedGeneratorInput); modal.addComponents(firstActionRow); this.some(modal) } catch (err) { console.log(err) } } }
createMessageComponentCollector()