problem with modal
hello i have problem. when two people fill out the modal at the same time, it bugs out and throws an error in the console.
```async execute(interaction) {
if(interaction.customId === 'aplikujmod'){
const modal = new ModalBuilder()
.setCustomId('rekrumod'+interaction.user.id)
.setTitle('Formularz na Moderatora');
const imie = new TextInputBuilder()
.setCustomId('imie-'+interaction.user.id+'')
.setPlaceholder('Imię i nazwisko')
.setLabel("Imię i nazwisko")
.setRequired(true)
.setStyle(TextInputStyle.Short);
const doswiadczenie = new TextInputBuilder()
.setCustomId('doswiadczenie-'+interaction.user.id)
.setPlaceholder('Tak/Nie, jak tak to jakie?')
.setLabel("Czy masz doświadczenie w moderowaniu?")
.setRequired(true)
.setStyle(TextInputStyle.Short);
const imieRow = new ActionRowBuilder().addComponents(imie);
const doswiadczenieRow = new ActionRowBuilder().addComponents(doswiadczenie);
modal.addComponents(imieRow, doswiadczenieRow);
const filter = (interaction) => interaction.customId === 'rekrumod'+interaction.user.id;
interaction.showModal(modal);
interaction
.awaitModalSubmit({ filter, time: 1000_000})
.then(async (modalInteraction) => {
const imieText = modalInteraction.fields.getTextInputValue('imie-'+interaction.user.id+'');
const doswiadczenieText = modalInteraction.fields.getTextInputValue('doswiadczenie-'+interaction.user.id);
const embed = new EmbedBuilder()
.setTitle("Rekrutacja na Moderatora")
.setDescription('Aplikacja użytkownika: <@' + interaction.user.id + '>')
.addFields(fields but i delete it because too many characters
)
.setThumbnail("https://imgur.com/FCbVUO5.png")
.setFooter({
text: "E-Sport Szczytno",
iconURL: "https://imgur.com/
12 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!Unknown User•8mo ago
Message Not Public
Sign In & Join Server To View
i do
and i have new problem xd
Unknown User•8mo ago
Message Not Public
Sign In & Join Server To View
i hope im reading the right message. idk how to create a unique id for a button when the button is always on the same channel
Unknown User•8mo ago
Message Not Public
Sign In & Join Server To View
wait, i have mindfuck xd and
what? i wrote it in the wrong place?
Unknown User•8mo ago
Message Not Public
Sign In & Join Server To View
"interaction.user.id" this? how else can i retrieve the user id?
Unknown User•8mo ago
Message Not Public
Sign In & Join Server To View
in console
and when i complete modal
the id is different
and im not getting the code to respond to the modal
Unknown User•8mo ago
Message Not Public
Sign In & Join Server To View