#problem with modal (error on discord but nothing on terminal
1 messages · Page 1 of 1 (latest)
Could you also show us the modal?
Remember not to have more than one collector on one file.
Are you activating the modal from a button?
Yes
Okay. Do you have a component handler to handle button clicks?
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.
I have this now and its not fonctionnate
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.
The select discipline is a select menu I want return this select menu after the modal
I dont Understand who I use awaitModalSubmit()
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.
This would actually be a StringSelectMenuBuilder in v14 (They changed the name of the class to differentiate between Strings, Channels, and Roles)
here is the file the code is in commands/course.js
I welcome you to use code blocks!
```js
//code
js
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?
In that file, you need to require those classes from discord.js not @discordjs/builders
who?