#TypeError ModalBuilder is not a constructor
17 messages · Page 1 of 1 (latest)
What exact version of version 13 are you on?
"discord.js": "^13.1.0",
thats what my packege says
ill update real quick maybe then it will work
Modals are not in that version. You're just using an outdated version
You should, because text-in-voice messages will crash your bot on that version
any other sythax on that version
For what?
like any code i need to edit to make it work on the newer version
I have error while try to show modal , the code
const { MessageActionRow,MessageSelectMenu,MessageEmbed,MessageButton,ActionRowBuilder, ModalBuilder, TextInputBuilder, TextInputStyle} = require('discord.js');
module.exports = {
name: "report",
description: "Report info",
run: async (client, interaction, args) => {
const modal = new ModalBuilder()
.setCustomId('submodal')
.setTitle('Report to us');
const ReportModal = new TextInputBuilder()
.setCustomId('repMod')
.setLabel("What do you wanna report to us")
.setStyle(TextInputStyle.Short);
const InfoModal = new TextInputBuilder()
.setCustomId('infoMod')
.setLabel("Please give us more information")
.setStyle(TextInputStyle.Paragraph);
const firstActionRow = new ActionRowBuilder().addComponents([ReportModal]);
const secondActionRow = new ActionRowBuilder().addComponents([InfoModal]);
modal.addComponents([firstActionRow, secondActionRow]);
await interaction.showModal(modal);
}
}
And get error about TypeError: ModalBuilder is not a constructor
You're using v14 code, but (according to your thread tag) you're running it on v13.9
Oh I use the v13.9 and get the code from doc, So i need to update to v14 right?
You might as well since you already started updating some code
The updating guide is in the #djs-help-v14 channel topic
Thanks