Modal help
im getting error
const modal = new ModalBuilder()
^
TypeError: ModalBuilder is not a constructor
10 Replies
• What's your exact discord.js
npm list discord.js
and node node -v
version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.TypeError: ModalBuilder is not a constructor
at Client.<anonymous> (/home/ubuntu/discord/logibot.js:95:18)
at Client.emit (node:events:390:28)
at InteractionCreateAction.handle (/home/ubuntu/discord/node_modules/discord.js/src/client/actions/InteractionCreate.js:83:12)
at Object.module.exports [as INTERACTION_CREATE] (/home/ubuntu/discord/node_modules/discord.js/src/client/websocket/handlers/INTERACTION_CREATE.js:4:36)
at WebSocketManager.handlePacket (/home/ubuntu/discord/node_modules/discord.js/src/client/websocket/WebSocketManager.js:346:31)
at WebSocketShard.onPacket (/home/ubuntu/discord/node_modules/discord.js/src/client/websocket/WebSocketShard.js:478:22)
at WebSocketShard.onMessage (/home/ubuntu/discord/node_modules/discord.js/src/client/websocket/WebSocketShard.js:317:10)
at WebSocket.onMessage (/home/ubuntu/discord/node_modules/ws/lib/event-target.js:199:18)
at WebSocket.emit (node:events:390:28)
at Receiver.receiverOnMessage (/home/ubuntu/discord/node_modules/ws/lib/websocket.js:1169:20)
Node.js v17.3.0
What's your exact discord.jsmainly the what djs version partnpm list discord.js
and nodenode -v
version?
"discord.js": "^13.8.1",
well the builders aren't exported directly from djs in v13
you're free to just use the
Modal
, MessageActionRow
, and TextInputComponent
classesgot a documentation url for that previous version?
they're both on the same website, you just have to change the branch to your specific version or stable for latest v13

ya was looking for an example code like is now live for v14
well you're welcome to check out that second link which is the v13 guide
it has a section on modals
(and includes example code for that)