// Get modal inputs
const brewName = modalInteraction.fields.getTextInputValue('brewNameInput');
const brewLink = modalInteraction.fields.getTextInputValue('brewLinkInput');
const brewInfo = modalInteraction.fields.getTextInputValue('brewInfoInput');
// Create message components
const brewTitleComponent = new TextDisplayBuilder().setContent(`# ${brewName}`);
const brewAuthorComponent = new TextDisplayBuilder().setContent(`Brewer: ${interaction.user}`);
const brewLinkComponent = new TextDisplayBuilder().setContent(`**[View the brew here](${brewLink})**`);
const brewButtonComponent = new ButtonBuilder()
.setLabel('Open Brew')
.setStyle(ButtonStyle.Link)
.setURL(brewLink)
const sectionComponent = new SectionBuilder()
.addTextDisplayComponents(brewTitleComponent, brewAuthorComponent, brewLinkComponent)
.setButtonAccessory(brewButtonComponent)
const brewSeparatorComponent = new SeparatorBuilder().setSpacing(SeparatorSpacingSize.Large);
const brewInfoComponent = new TextDisplayBuilder().setContent(brewInfo);
const brewMentionComponent = new TextDisplayBuilder().setContent(`\nTime to get to work ${role}!`);
const containerComponent = new ContainerBuilder()
.addSectionComponents(sectionComponent)
.addSeparatorComponents(brewSeparatorComponent)
.addTextDisplayComponents(brewInfoComponent, brewMentionComponent)
// Create forum post
const forum = interaction.guild.channels.cache.get(brewChannelId);
forum.threads.create({
name: `${interaction.user.displayName} - ${brewName}`,
message: ({
flags: MessageFlags.IsComponentsV2,
components: [containerComponent]
})
});
// Get modal inputs
const brewName = modalInteraction.fields.getTextInputValue('brewNameInput');
const brewLink = modalInteraction.fields.getTextInputValue('brewLinkInput');
const brewInfo = modalInteraction.fields.getTextInputValue('brewInfoInput');
// Create message components
const brewTitleComponent = new TextDisplayBuilder().setContent(`# ${brewName}`);
const brewAuthorComponent = new TextDisplayBuilder().setContent(`Brewer: ${interaction.user}`);
const brewLinkComponent = new TextDisplayBuilder().setContent(`**[View the brew here](${brewLink})**`);
const brewButtonComponent = new ButtonBuilder()
.setLabel('Open Brew')
.setStyle(ButtonStyle.Link)
.setURL(brewLink)
const sectionComponent = new SectionBuilder()
.addTextDisplayComponents(brewTitleComponent, brewAuthorComponent, brewLinkComponent)
.setButtonAccessory(brewButtonComponent)
const brewSeparatorComponent = new SeparatorBuilder().setSpacing(SeparatorSpacingSize.Large);
const brewInfoComponent = new TextDisplayBuilder().setContent(brewInfo);
const brewMentionComponent = new TextDisplayBuilder().setContent(`\nTime to get to work ${role}!`);
const containerComponent = new ContainerBuilder()
.addSectionComponents(sectionComponent)
.addSeparatorComponents(brewSeparatorComponent)
.addTextDisplayComponents(brewInfoComponent, brewMentionComponent)
// Create forum post
const forum = interaction.guild.channels.cache.get(brewChannelId);
forum.threads.create({
name: `${interaction.user.displayName} - ${brewName}`,
message: ({
flags: MessageFlags.IsComponentsV2,
components: [containerComponent]
})
});