Nils
Nils
DIAdiscord.js - Imagine an app
Created by Nils on 4/2/2024 in #djs-questions
Problem with Modal Builders
@Qjuh
7 replies
DIAdiscord.js - Imagine an app
Created by Nils on 4/2/2024 in #djs-questions
Problem with Modal Builders
it comes when i make channel.send()
7 replies
DIAdiscord.js - Imagine an app
Created by Nils on 4/2/2024 in #djs-questions
Problem with Modal Builders
but what is here the problem
7 replies
DIAdiscord.js - Imagine an app
Created by Nils on 4/2/2024 in #djs-questions
Problem with Modal Builders
.then(async (modalInteraction) => {
const firstNameValue = modalInteraction.fields.getTextInputValue('verify_first_name');
const lastNameValue = modalInteraction.fields.getTextInputValue('verify_last_name');
const idValue = modalInteraction.fields.getTextInputValue('verify_id');

const embed = new EmbedBuilder()
.setTitle('Verifizierungs Anfrage')
.setDescription('' +
'**Vorname: **' + firstNameValue +
'**Nachname: **' + lastNameValue +
'**ID: **' + idValue,
);

const button = new ButtonBuilder()
.setCustomId('accept_verification')
.setStyle('Success')
.setLabel('Akzeptieren');

const channel = await client.channels.fetch('1224773916279439430').then();
await channel.send({
embeds: [embed],
});
}).catch(console.error);
.then(async (modalInteraction) => {
const firstNameValue = modalInteraction.fields.getTextInputValue('verify_first_name');
const lastNameValue = modalInteraction.fields.getTextInputValue('verify_last_name');
const idValue = modalInteraction.fields.getTextInputValue('verify_id');

const embed = new EmbedBuilder()
.setTitle('Verifizierungs Anfrage')
.setDescription('' +
'**Vorname: **' + firstNameValue +
'**Nachname: **' + lastNameValue +
'**ID: **' + idValue,
);

const button = new ButtonBuilder()
.setCustomId('accept_verification')
.setStyle('Success')
.setLabel('Akzeptieren');

const channel = await client.channels.fetch('1224773916279439430').then();
await channel.send({
embeds: [embed],
});
}).catch(console.error);
DiscordAPIError[50035]: Invalid Form Body components[0][UNION_TYPE_CHOICES]: Value of field "type" must be one of (1,). at handleErrors (/Users/nils/development/discord-bot/node_modules/@discordjs/rest/dist/index.js:722:13) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async SequentialHandler.runRequest (/Users/nils/development/discord-bot/node_modules/@discordjs/rest/dist/index.js:1120:23) at async SequentialHandler.queueRequest (/Users/nils/development/discord-bot/node_modules/@discordjs/rest/dist/index.js:953:14) at async _REST.request (/Users/nils/development/discord-bot/node_modules/@discordjs/rest/dist/index.js:1266:22) at async TextChannel.send (/Users/nils/development/discord-bot/node_modules/discord.js/src/structures/interfaces/TextBasedChannel.js:155:15) at async /Users/nils/development/discord-bot/src/index.js:89:5 { requestBody: { files: [], json: { content: undefined, tts: false, nonce: undefined, embeds: [Array], components: [Array], username: undefined, avatar_url: undefined, allowed_mentions: undefined, flags: undefined, message_reference: undefined, attachments: undefined, sticker_ids: undefined, thread_name: undefined } }, rawError: { message: 'Invalid Form Body', code: 50035, errors: { components: [Object] } }, code: 50035, status: 400, method: 'POST', url: 'https://discord.com/api/v10/channels/1224773916279439430/messages' }
7 replies
DIAdiscord.js - Imagine an app
Created by Nils on 4/2/2024 in #djs-questions
Problem with Modal Builders
ok
7 replies