#problem with modal (error on discord but nothing on terminal

1 messages · Page 1 of 1 (latest)

random notch
#

hello I have problem with the modals I managed to make one appear but when I want to confirm my choices an error message appears on discord but nothing on the terminal if you have the ability to help me and that you nice. THANKS

#

I know the error comes from the collector but I have no idea how to fix it

ocean gull
#

Could you also show us the modal?

#

Remember not to have more than one collector on one file.

random notch
#

and indeed I have several collectors how can I manage with a single collector?

ocean gull
#

Are you activating the modal from a button?

random notch
#

Yes

ocean gull
#

Okay. Do you have a component handler to handle button clicks?

random notch
ocean gull
#

Use the same collector throughout.
Create the collector on the modal. And just switch between the custom id for what you want to do. Just to test it first, console log under each custom id.

#

Or in your case, remove the bottom two collectors. Then switch between custom ids on the first collector.

#

Also remove the last part of the filter.

random notch
#

I have this now and its not fonctionnate

ocean gull
#

No only one collector.on('collect')

#

So essentially you want the following:
/course return course message and button
click on button return show modal
Fill out the fields and return the fields.
But I don't see where you created selectDisipline so I'm not sure what you are doing with it.

#

You actually need to get rid of that particular collector and use awaitModalSubmit() after button click.

random notch
#

The select discipline is a select menu I want return this select menu after the modal

#

I dont Understand who I use awaitModalSubmit()

random notch
#

@ocean gull

#

sorry to bother you

ocean gull
#

Okay so .addOptions doesn't need to be in an array. It converts an object to an array on its own. This would be a lot easier to see all of the code instead of parts.

ocean gull
random notch
ocean gull
#

I welcome you to use code blocks!

```js
//code
random notch
ocean gull
#

I don't download files (most are not compatible with my OS)

#

You are trying to pull everything from the /builders package... Are you on v14?

random notch
ocean gull
#

In that file, you need to require those classes from discord.js not @discordjs/builders

random notch
#

who?