JFK
JFK
DIAdiscord.js - Imagine an app
Created by JFK on 10/19/2023 in #djs-questions
Error Sending Modals
Thank you
19 replies
DIAdiscord.js - Imagine an app
Created by JFK on 10/19/2023 in #djs-questions
Error Sending Modals
yupppp
19 replies
DIAdiscord.js - Imagine an app
Created by JFK on 10/19/2023 in #djs-questions
Error Sending Modals
Good call
19 replies
DIAdiscord.js - Imagine an app
Created by JFK on 10/19/2023 in #djs-questions
Error Sending Modals
Thats it
19 replies
DIAdiscord.js - Imagine an app
Created by JFK on 10/19/2023 in #djs-questions
Error Sending Modals
import { ActionRowBuilder, TextInputBuilder } from "@discordjs/builders";
19 replies
DIAdiscord.js - Imagine an app
Created by JFK on 10/19/2023 in #djs-questions
Error Sending Modals
Kinda wish this error was more clear honestly, I'm not sure whats undefined
19 replies
DIAdiscord.js - Imagine an app
Created by JFK on 10/19/2023 in #djs-questions
Error Sending Modals
{
"name": "proj",
"version": "1.0.0",
"description": "",
"main": "app.js",
"type": "module",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"axios": "^1.5.1",
"chalk": "^5.3.0",
"discord.js": "^14.13.0",
"dotenv": "^16.3.1",
"mongoose": "^7.6.2"
}
}
{
"name": "proj",
"version": "1.0.0",
"description": "",
"main": "app.js",
"type": "module",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"axios": "^1.5.1",
"chalk": "^5.3.0",
"discord.js": "^14.13.0",
"dotenv": "^16.3.1",
"mongoose": "^7.6.2"
}
}
19 replies
DIAdiscord.js - Imagine an app
Created by JFK on 10/19/2023 in #djs-questions
Error Sending Modals
What're you thinking?
19 replies
DIAdiscord.js - Imagine an app
Created by JFK on 10/19/2023 in #djs-questions
Error Sending Modals
modal.addComponents(firstActionRow);
19 replies
DIAdiscord.js - Imagine an app
Created by JFK on 10/19/2023 in #djs-questions
Error Sending Modals
const modal = new ModalBuilder().setCustomId("myModal").setTitle("My Modal");

// Add components to modal

// Create the text input components
const favoriteColorInput = new TextInputBuilder()
.setCustomId("favoriteColorInput")
// The label is the prompt the user sees for this input
.setLabel("What's your favorite color?")
// Short means only a single line of text
.setStyle(TextInputStyle.Short);

const hobbiesInput = new TextInputBuilder()
.setCustomId("hobbiesInput")
.setLabel("What's some of your favorite hobbies?")
// Paragraph means multiple lines of text.
.setStyle(TextInputStyle.Paragraph);

// An action row only holds one text input,
// so you need one action row per text input.
let firstActionRow = new ActionRowBuilder();

firstActionRow.addComponents(favoriteColorInput);
const secondActionRow = new ActionRowBuilder().addComponents(hobbiesInput);

// Add inputs to the modal
modal.addComponents(firstActionRow);

// Show the modal to the user
await interaction.showModal(modal);
const modal = new ModalBuilder().setCustomId("myModal").setTitle("My Modal");

// Add components to modal

// Create the text input components
const favoriteColorInput = new TextInputBuilder()
.setCustomId("favoriteColorInput")
// The label is the prompt the user sees for this input
.setLabel("What's your favorite color?")
// Short means only a single line of text
.setStyle(TextInputStyle.Short);

const hobbiesInput = new TextInputBuilder()
.setCustomId("hobbiesInput")
.setLabel("What's some of your favorite hobbies?")
// Paragraph means multiple lines of text.
.setStyle(TextInputStyle.Paragraph);

// An action row only holds one text input,
// so you need one action row per text input.
let firstActionRow = new ActionRowBuilder();

firstActionRow.addComponents(favoriteColorInput);
const secondActionRow = new ActionRowBuilder().addComponents(hobbiesInput);

// Add inputs to the modal
modal.addComponents(firstActionRow);

// Show the modal to the user
await interaction.showModal(modal);
19 replies
DIAdiscord.js - Imagine an app
Created by JFK on 10/19/2023 in #djs-questions
Error Sending Modals
Error: Cannot properly serialize component type: undefined
at createComponentBuilder (C:\Users\Administrator\Desktop\Node Projects\BlitzBet\node_modules\@discordjs\builders\dist\index.js:1234:13)
at C:\Users\Administrator\Desktop\Node Projects\BlitzBet\node_modules\@discordjs\builders\dist\index.js:1284:54
at Array.map (<anonymous>)
at new ActionRowBuilder (C:\Users\Administrator\Desktop\Node Projects\BlitzBet\node_modules\@discordjs\builders\dist\index.js:1284:35)
at C:\Users\Administrator\Desktop\Node Projects\BlitzBet\node_modules\@discordjs\builders\dist\index.js:1380:76
at Array.map (<anonymous>)
at ModalBuilder.addComponents (C:\Users\Administrator\Desktop\Node Projects\BlitzBet\node_modules\@discordjs\builders\dist\index.js:1379:37)
at default (file:///C:/Users/Administartor/Desktop/Node%20Projects/BlitzBet/src/listeners/interactions/bets/pickemBet.js:123:9)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async default (file:///C:/Users/Administartor/Desktop/Node%20Projects/BlitzBet/src/listeners/interactions/button.js:18:5)
Error: Cannot properly serialize component type: undefined
at createComponentBuilder (C:\Users\Administrator\Desktop\Node Projects\BlitzBet\node_modules\@discordjs\builders\dist\index.js:1234:13)
at C:\Users\Administrator\Desktop\Node Projects\BlitzBet\node_modules\@discordjs\builders\dist\index.js:1284:54
at Array.map (<anonymous>)
at new ActionRowBuilder (C:\Users\Administrator\Desktop\Node Projects\BlitzBet\node_modules\@discordjs\builders\dist\index.js:1284:35)
at C:\Users\Administrator\Desktop\Node Projects\BlitzBet\node_modules\@discordjs\builders\dist\index.js:1380:76
at Array.map (<anonymous>)
at ModalBuilder.addComponents (C:\Users\Administrator\Desktop\Node Projects\BlitzBet\node_modules\@discordjs\builders\dist\index.js:1379:37)
at default (file:///C:/Users/Administartor/Desktop/Node%20Projects/BlitzBet/src/listeners/interactions/bets/pickemBet.js:123:9)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async default (file:///C:/Users/Administartor/Desktop/Node%20Projects/BlitzBet/src/listeners/interactions/button.js:18:5)
19 replies
DIAdiscord.js - Imagine an app
Created by JFK on 10/19/2023 in #djs-questions
Error Sending Modals
node 18.17.1
19 replies