#TypeError: Cannot read properties of undefined (reading 'getTextInputValue')
7 messages · Page 1 of 1 (latest)
const ticket_modal_nickname1 = await interaction.fields.getTextInputValue('ticket_modal_nickname');
Some interaction types do not have a .fields property so interaction.fields may be undefined. Use type guards so that this only gets checked for modal submit interactions
Also it doesn't need to be awaited because it's not a Promise
You don't have to replace it, just don't try to use it unless you check whether the interaction is a modal first
Yes it will work if the interaction is a modal
Yep, that's the correct type guard
Then the code isn't running or the interaction isn't a modal