[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
monbrey3y ago
inputs dont have titles they have a label
chris™
chris™OP3y ago
that was my re-write but earlier with label, I had the same prob
monbrey
monbrey3y ago
are you sure? setTitle on modal. setLabel on input
chris™
chris™OP3y 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
monbrey3y ago
okay cool, so a new error They also dont have descriptions .setPlaceholder()?
d.js docs
d.js docs3y ago
class TextInputBuilder (extends ComponentBuilder) Represents a discord component
chris™
chris™OP3y 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
monbrey3y ago
VSC literally guessed based on stuff you've written before in JavaScript
chris™
chris™OP3y 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
monbrey3y ago
Well it is now
chris™
chris™OP3y ago
ah, thanks
monbrey
monbrey3y ago
It's setValue in discord.js
chris™
chris™OP3y 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 docs3y ago
guide Interactions: Modals read moreguide Interactions: Building and responding with modals read more
chris™
chris™OP3y 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 docs3y ago
class ModalBuilderclass TextInputBuilder (extends ComponentBuilder) Represents a discord component
Want results from more Discord servers?
Add your server