ajzak
ajzak
DIAdiscord.js - Imagine an app
Created by ajzak on 4/8/2024 in #djs-questions
problem with modal
and im not getting the code to respond to the modal
16 replies
DIAdiscord.js - Imagine an app
Created by ajzak on 4/8/2024 in #djs-questions
problem with modal
async execute(interaction) {
console.log('first '+interaction.id)
if(interaction.customId === 'aplikujmod'){
console.log('second '+interaction.id)
const modal = new ModalBuilder()
.setCustomId('rekrumod'+interaction.id)
.setTitle('Formularz na Moderatora');
[........]
const doswiadczenieRow = new ActionRowBuilder().addComponents(doswiadczenie);
modal.addComponents(imieRow, wiekRow, dlaczegoRow, doswiadczenieRow);
const filter = (interaction) => interaction.customId === 'rekrumod'+interaction.id;
console.log('third '+interaction.id)
async execute(interaction) {
console.log('first '+interaction.id)
if(interaction.customId === 'aplikujmod'){
console.log('second '+interaction.id)
const modal = new ModalBuilder()
.setCustomId('rekrumod'+interaction.id)
.setTitle('Formularz na Moderatora');
[........]
const doswiadczenieRow = new ActionRowBuilder().addComponents(doswiadczenie);
modal.addComponents(imieRow, wiekRow, dlaczegoRow, doswiadczenieRow);
const filter = (interaction) => interaction.customId === 'rekrumod'+interaction.id;
console.log('third '+interaction.id)
in console
first 1227039301020160040
second 1227039301020160040
third 1227039301020160040
first 1227039301020160040
second 1227039301020160040
third 1227039301020160040
and when i complete modal
first 1227039331802284033
first 1227039331802284033
the id is different
16 replies
DIAdiscord.js - Imagine an app
Created by ajzak on 4/8/2024 in #djs-questions
problem with modal
"interaction.user.id" this? how else can i retrieve the user id?
16 replies
DIAdiscord.js - Imagine an app
Created by ajzak on 4/8/2024 in #djs-questions
problem with modal
wait, i have mindfuck xd
const modal = new ModalBuilder()
.setCustomId(interaction.user.id)
const modal = new ModalBuilder()
.setCustomId(interaction.user.id)
and what? i wrote it in the wrong place?
16 replies
DIAdiscord.js - Imagine an app
Created by ajzak on 4/8/2024 in #djs-questions
problem with modal
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
16 replies
DIAdiscord.js - Imagine an app
Created by ajzak on 4/8/2024 in #djs-questions
problem with modal
and i have new problem
J:\Projekty Node.js\e-sport szczytno\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:102
if (this.deferred || this.replied) throw new DiscordjsError(ErrorCodes.InteractionAlreadyReplied);
^

Error [InteractionAlreadyReplied]: The reply to this interaction has already been sent or deferred.
at ModalSubmitInteraction.reply (J:\Projekty Node.js\e-sport szczytno\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:102:46)
at J:\Projekty Node.js\e-sport szczytno\events\RekrutacjaModEvent.js:86:44
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
code: 'InteractionAlreadyReplied'
}
J:\Projekty Node.js\e-sport szczytno\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:102
if (this.deferred || this.replied) throw new DiscordjsError(ErrorCodes.InteractionAlreadyReplied);
^

Error [InteractionAlreadyReplied]: The reply to this interaction has already been sent or deferred.
at ModalSubmitInteraction.reply (J:\Projekty Node.js\e-sport szczytno\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:102:46)
at J:\Projekty Node.js\e-sport szczytno\events\RekrutacjaModEvent.js:86:44
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
code: 'InteractionAlreadyReplied'
}
xd
16 replies
DIAdiscord.js - Imagine an app
Created by ajzak on 4/8/2024 in #djs-questions
problem with modal
i do
const modal = new ModalBuilder()
.setCustomId('rekrumod'+interaction.user.id)
const modal = new ModalBuilder()
.setCustomId('rekrumod'+interaction.user.id)
16 replies