Byby
DIAdiscord.js - Imagine an app
•Created by Byby on 2/7/2024 in #djs-questions
Modal not opening
thanks ig:FeelsBadMan:
8 replies
DIAdiscord.js - Imagine an app
•Created by Byby on 2/7/2024 in #djs-questions
Modal not opening
i dont think i did it right . I dont know js that good, as im following a tutorial. I only know the basics
await interaction.showModal(modal);
console.log
await interaction.showModal(modal);
console.log
8 replies
DIAdiscord.js - Imagine an app
•Created by Byby on 2/7/2024 in #djs-questions
Modal not opening
const fourthActionRow = new ActionRowBuilder().addComponents(embedverifybuttontext);
const fifthActionRow = new ActionRowBuilder().addComponents(embedhelpbuttontext);
modal.addComponents(firstActionRow, secondActionRow, thirdActionRow, fourthActionRow, fifthActionRow);
await interaction.showModal(modal);
},
}
const fourthActionRow = new ActionRowBuilder().addComponents(embedverifybuttontext);
const fifthActionRow = new ActionRowBuilder().addComponents(embedhelpbuttontext);
modal.addComponents(firstActionRow, secondActionRow, thirdActionRow, fourthActionRow, fifthActionRow);
await interaction.showModal(modal);
},
}
8 replies
DIAdiscord.js - Imagine an app
•Created by Byby on 2/7/2024 in #djs-questions
Modal not opening
const { ActionRowBuilder, ModalBuilder, TextInputBuilder, TextInputStyle, SlashCommandBuilder} = require('discord.js');
module.exports = {
data: new SlashCommandBuilder()
.setName('setup')
.setDescription('Sends the Embed'),
run: async ({ interaction }) => {
const modal = new ModalBuilder({
customId: `mymodal-${interaction.user.id}`,
title: 'creating the embed'
});
const embedtitle = new TextInputBuilder({
customId: 'embedtitle',
label: 'embed title',
style: TextInputStyle.Short,
});
const embeddescription = new TextInputBuilder({
customId: 'embeddescription',
label: 'embed description',
style: TextInputStyle.Paragraph,
});
const embedcolor = new TextInputBuilder({
customId: 'embedcolor',
label: 'embed color',
style: TextInputStyle.Short,
});
const embedverifybuttontext = new TextInputBuilder({
customId: 'embedverifybuttontext',
label: 'embed verify button text',
style: TextInputStyle.Short,
});
const embedhelpbuttontext = new TextInputBuilder({
customId: 'embedhelpbuttontext',
label: 'embed help button text',
style: TextInputStyle.Short,
});
const firstActionRow = new ActionRowBuilder().addComponents(embedtitle);
const secondActionRow = new ActionRowBuilder().addComponents(embeddescription);
const thirdActionRow = new ActionRowBuilder().addComponents(embedcolor);
const { ActionRowBuilder, ModalBuilder, TextInputBuilder, TextInputStyle, SlashCommandBuilder} = require('discord.js');
module.exports = {
data: new SlashCommandBuilder()
.setName('setup')
.setDescription('Sends the Embed'),
run: async ({ interaction }) => {
const modal = new ModalBuilder({
customId: `mymodal-${interaction.user.id}`,
title: 'creating the embed'
});
const embedtitle = new TextInputBuilder({
customId: 'embedtitle',
label: 'embed title',
style: TextInputStyle.Short,
});
const embeddescription = new TextInputBuilder({
customId: 'embeddescription',
label: 'embed description',
style: TextInputStyle.Paragraph,
});
const embedcolor = new TextInputBuilder({
customId: 'embedcolor',
label: 'embed color',
style: TextInputStyle.Short,
});
const embedverifybuttontext = new TextInputBuilder({
customId: 'embedverifybuttontext',
label: 'embed verify button text',
style: TextInputStyle.Short,
});
const embedhelpbuttontext = new TextInputBuilder({
customId: 'embedhelpbuttontext',
label: 'embed help button text',
style: TextInputStyle.Short,
});
const firstActionRow = new ActionRowBuilder().addComponents(embedtitle);
const secondActionRow = new ActionRowBuilder().addComponents(embeddescription);
const thirdActionRow = new ActionRowBuilder().addComponents(embedcolor);
8 replies