[SOLVED] TypeError (intermediate value).setCustomId(...).setTitle is not a function

Where is the creation guide, v14 broke my modals
const configurationModal = new ModalBuilder()
.setCustomId(`errorConfigurationModal`)
.setTitle('⚙️ Bot Configuration')
//.setDescription('**Warning** This is not the server configuration! This is the entire bot domain!!!')
new ActionRowBuilder().addComponents(
new TextInputBuilder()
.setCustomId('errorLog_channel')
.setTitle('Error Channel ID')
.setDescription('The channel all errors are directed into. To disable, set to 0.')
.setDefaultValue(errorChannel_ID)
.setStyle('Short')
.setRequired(true)
)
const configurationModal = new ModalBuilder()
.setCustomId(`errorConfigurationModal`)
.setTitle('⚙️ Bot Configuration')
//.setDescription('**Warning** This is not the server configuration! This is the entire bot domain!!!')
new ActionRowBuilder().addComponents(
new TextInputBuilder()
.setCustomId('errorLog_channel')
.setTitle('Error Channel ID')
.setDescription('The channel all errors are directed into. To disable, set to 0.')
.setDefaultValue(errorChannel_ID)
.setStyle('Short')
.setRequired(true)
)
Last time I checked, this was the correct way to make modals-
16 Replies
monbrey
monbrey2y ago
inputs dont have titles they have a label
chris™
chris™2y ago
that was my re-write but earlier with label, I had the same prob
monbrey
monbrey2y ago
are you sure? setTitle on modal. setLabel on input
chris™
chris™2y ago
Alright here I changed it:
const configurationModal = new ModalBuilder()
.setCustomId(`errorConfigurationModal`)
.setTitle('⚙️ Bot Configuration')
//.setDescription('**Warning** This is not the server configuration! This is the entire bot domain!!!')
new ActionRowBuilder().addComponents(
new TextInputBuilder()
.setCustomId('errorLog_channel')
.setLabel('Error Channel ID')
.setDescription('The channel all errors are directed into. To disable, set to 0.')
.setDefaultValue(errorChannel_ID)
.setStyle('Short')
.setRequired(true)
)
const configurationModal = new ModalBuilder()
.setCustomId(`errorConfigurationModal`)
.setTitle('⚙️ Bot Configuration')
//.setDescription('**Warning** This is not the server configuration! This is the entire bot domain!!!')
new ActionRowBuilder().addComponents(
new TextInputBuilder()
.setCustomId('errorLog_channel')
.setLabel('Error Channel ID')
.setDescription('The channel all errors are directed into. To disable, set to 0.')
.setDefaultValue(errorChannel_ID)
.setStyle('Short')
.setRequired(true)
)
TypeError: (intermediate value).setCustomId(...).setLabel(...).setDescription is not a function
monbrey
monbrey2y ago
okay cool, so a new error They also dont have descriptions .setPlaceholder()?
d.js docs
d.js docs2y ago
class TextInputBuilder (extends ComponentBuilder) Represents a discord component
chris™
chris™2y ago
I'll try getting my original code which worked before v14 I just added description and title by accident cuz it suggested in vscode for some reason
monbrey
monbrey2y ago
VSC literally guessed based on stuff you've written before in JavaScript
chris™
chris™2y ago
with embeds it had embed options Ok, actually I have a theory it must be setDefaultValue yea it is: TypeError: (intermediate value).setCustomId(...).setLabel(...).setDefaultValue is not a function I saw it was .setValue but that didn't work when I tried it with discord-modals
monbrey
monbrey2y ago
Well it is now
chris™
chris™2y ago
ah, thanks
monbrey
monbrey2y ago
It's setValue in discord.js
chris™
chris™2y ago
Also for future reference, is there and doc on modal creation? that has all these features like the modal one
d.js docs
d.js docs2y ago
guide Interactions: Modals read moreguide Interactions: Building and responding with modals read more
chris™
chris™2y ago
Yea I saw that but it doesn't have all the options I assume, because it doesn't mention .setMax/Min and .setValue Anyways, thanks 🙏
d.js docs
d.js docs2y ago
class ModalBuilderclass TextInputBuilder (extends ComponentBuilder) Represents a discord component