ierdna100
ierdna100
DIAdiscord.js - Imagine an app
Created by ierdna100 on 1/27/2024 in #djs-questions
ExpectedValidatorError on showModal()
Thanks, I guess
35 replies
DIAdiscord.js - Imagine an app
Created by ierdna100 on 1/27/2024 in #djs-questions
ExpectedValidatorError on showModal()
Very odd
35 replies
DIAdiscord.js - Imagine an app
Created by ierdna100 on 1/27/2024 in #djs-questions
ExpectedValidatorError on showModal()
Youre right, I cant reproduce it at all, even in the same project but clean (ran npm init and all that jazz)
35 replies
DIAdiscord.js - Imagine an app
Created by ierdna100 on 1/27/2024 in #djs-questions
ExpectedValidatorError on showModal()
Should I setup a new JS project to test it?
35 replies
DIAdiscord.js - Imagine an app
Created by ierdna100 on 1/27/2024 in #djs-questions
ExpectedValidatorError on showModal()
No description
35 replies
DIAdiscord.js - Imagine an app
Created by ierdna100 on 1/27/2024 in #djs-questions
ExpectedValidatorError on showModal()
This does not have the same issue, the component can be an object:
const username = new TextInputBuilder()
.setCustomId("username")
.setMaxLength(20)
.setPlaceholder("Display name")
.setLabel("Your display name")
.setRequired(true)
.setStyle(TextInputStyle.Short);

const firstActionRow = new ActionRowBuilder<TextInputBuilder>().addComponents(username);
const username = new TextInputBuilder()
.setCustomId("username")
.setMaxLength(20)
.setPlaceholder("Display name")
.setLabel("Your display name")
.setRequired(true)
.setStyle(TextInputStyle.Short);

const firstActionRow = new ActionRowBuilder<TextInputBuilder>().addComponents(username);
35 replies
DIAdiscord.js - Imagine an app
Created by ierdna100 on 1/27/2024 in #djs-questions
ExpectedValidatorError on showModal()
i.e.: This works:
const firstActionRow = new ActionRowBuilder<TextInputBuilder>({
components: [
{
custom_id: "username",
max_length: 20,
placeholder: "Display name",
style: TextInputStyle.Short,
label: "Your display name",
type: ComponentType.TextInput
}
]
});

this.modalBuilder = new ModalBuilder().setCustomId("schedule_builder").setTitle("Input your schedule here!").addComponents(firstActionRow.toJSON());
const firstActionRow = new ActionRowBuilder<TextInputBuilder>({
components: [
{
custom_id: "username",
max_length: 20,
placeholder: "Display name",
style: TextInputStyle.Short,
label: "Your display name",
type: ComponentType.TextInput
}
]
});

this.modalBuilder = new ModalBuilder().setCustomId("schedule_builder").setTitle("Input your schedule here!").addComponents(firstActionRow.toJSON());
This does not:
const firstActionRow = new ActionRowBuilder<TextInputBuilder>({
components: [
{
custom_id: "username",
max_length: 20,
placeholder: "Display name",
style: TextInputStyle.Short,
label: "Your display name",
type: ComponentType.TextInput
}
]
});

this.modalBuilder = new ModalBuilder().setCustomId("schedule_builder").setTitle("Input your schedule here!").addComponents(firstActionRow);
const firstActionRow = new ActionRowBuilder<TextInputBuilder>({
components: [
{
custom_id: "username",
max_length: 20,
placeholder: "Display name",
style: TextInputStyle.Short,
label: "Your display name",
type: ComponentType.TextInput
}
]
});

this.modalBuilder = new ModalBuilder().setCustomId("schedule_builder").setTitle("Input your schedule here!").addComponents(firstActionRow);
35 replies
DIAdiscord.js - Imagine an app
Created by ierdna100 on 1/27/2024 in #djs-questions
ExpectedValidatorError on showModal()
No description
35 replies
DIAdiscord.js - Imagine an app
Created by ierdna100 on 1/27/2024 in #djs-questions
ExpectedValidatorError on showModal()
Ive managed to get it working, all it required was that the ModalBuilder's .addComponents() takes actionRow.toJSON(), and not the ActionRow itself, although the type checker does think it is correct
35 replies
DIAdiscord.js - Imagine an app
Created by ierdna100 on 1/27/2024 in #djs-questions
ExpectedValidatorError on showModal()
Okay I think the definitions for Typescript are bugged
35 replies
DIAdiscord.js - Imagine an app
Created by ierdna100 on 1/27/2024 in #djs-questions
ExpectedValidatorError on showModal()
Oh my god youve got to be kidding me
35 replies
DIAdiscord.js - Imagine an app
Created by ierdna100 on 1/27/2024 in #djs-questions
ExpectedValidatorError on showModal()
This is the modal's file
35 replies
DIAdiscord.js - Imagine an app
Created by ierdna100 on 1/27/2024 in #djs-questions
ExpectedValidatorError on showModal()
35 replies
DIAdiscord.js - Imagine an app
Created by ierdna100 on 1/27/2024 in #djs-questions
ExpectedValidatorError on showModal()
Sorry, I went to sleep. I've experimented more and now I get a different fun error when I split the modal creation into multiple parts
D:\code\javascript\discordBots\schedulingBot\node_modules\@discordjs\builders\dist\index.js:1384
throw new Error(`Cannot properly serialize component type: ${data.type}`);
^

Error: Cannot properly serialize component type: undefined
at createComponentBuilder (D:\code\javascript\discordBots\schedulingBot\node_modules\@discordjs\builders\dist\index.js:1384:13)
at D:\code\javascript\discordBots\schedulingBot\node_modules\@discordjs\builders\dist\index.js:1434:54
at Array.map (<anonymous>)
at new ActionRowBuilder (D:\code\javascript\discordBots\schedulingBot\node_modules\@discordjs\builders\dist\index.js:1434:35)
at D:\code\javascript\discordBots\schedulingBot\node_modules\@discordjs\builders\dist\index.js:1530:76
at Array.map (<anonymous>)
at ModalBuilder.addComponents (D:\code\javascript\discordBots\schedulingBot\node_modules\@discordjs\builders\dist\index.js:1529:37)
at new Modal_ScheduleUpload (file:///D:/code/javascript/discordBots/schedulingBot/build/discordServer/commands/modals/Modal_UploadSchedule.js:19:118)
at Function.loadModals (file:///D:/code/javascript/discordBots/schedulingBot/build/discordServer/commands/ModalLoader.js:8:37)
PS D:\code\javascript\discordBots\schedulingBot>
D:\code\javascript\discordBots\schedulingBot\node_modules\@discordjs\builders\dist\index.js:1384
throw new Error(`Cannot properly serialize component type: ${data.type}`);
^

Error: Cannot properly serialize component type: undefined
at createComponentBuilder (D:\code\javascript\discordBots\schedulingBot\node_modules\@discordjs\builders\dist\index.js:1384:13)
at D:\code\javascript\discordBots\schedulingBot\node_modules\@discordjs\builders\dist\index.js:1434:54
at Array.map (<anonymous>)
at new ActionRowBuilder (D:\code\javascript\discordBots\schedulingBot\node_modules\@discordjs\builders\dist\index.js:1434:35)
at D:\code\javascript\discordBots\schedulingBot\node_modules\@discordjs\builders\dist\index.js:1530:76
at Array.map (<anonymous>)
at ModalBuilder.addComponents (D:\code\javascript\discordBots\schedulingBot\node_modules\@discordjs\builders\dist\index.js:1529:37)
at new Modal_ScheduleUpload (file:///D:/code/javascript/discordBots/schedulingBot/build/discordServer/commands/modals/Modal_UploadSchedule.js:19:118)
at Function.loadModals (file:///D:/code/javascript/discordBots/schedulingBot/build/discordServer/commands/ModalLoader.js:8:37)
PS D:\code\javascript\discordBots\schedulingBot>
35 replies
DIAdiscord.js - Imagine an app
Created by ierdna100 on 1/27/2024 in #djs-questions
ExpectedValidatorError on showModal()
The modal or the command reply manager?
35 replies
DIAdiscord.js - Imagine an app
Created by ierdna100 on 1/27/2024 in #djs-questions
ExpectedValidatorError on showModal()
Of?
35 replies
DIAdiscord.js - Imagine an app
Created by ierdna100 on 1/27/2024 in #djs-questions
ExpectedValidatorError on showModal()
The rest works, replacing the .showModal() with a .reply() successfully responds
35 replies
DIAdiscord.js - Imagine an app
Created by ierdna100 on 1/27/2024 in #djs-questions
ExpectedValidatorError on showModal()
No description
35 replies
DIAdiscord.js - Imagine an app
Created by ierdna100 on 1/27/2024 in #djs-questions
ExpectedValidatorError on showModal()
No description
35 replies
DIAdiscord.js - Imagine an app
Created by ierdna100 on 1/27/2024 in #djs-questions
ExpectedValidatorError on showModal()
Yes
35 replies