Hi! I have an error.

This is the error:
node:events:498
throw er; // Unhandled 'error' event
^

ReferenceError: ChannelType is not defined
at Client.<anonymous> (D:\atermibot\index.js:77:34)
at Client.emit (node:events:520:28)
at MessageCreateAction.handle (D:\atermibot\node_modules\discord.js\src\client\actions\MessageCreate.js:28:14)
at module.exports [as MESSAGE_CREATE] (D:\atermibot\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (D:\atermibot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:355:31)
at WebSocketManager.<anonymous> (D:\atermibot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:239:12)
at WebSocketManager.emit (D:\atermibot\node_modules\@vladfrangu\async_event_emitter\dist\index.cjs:287:31)
at WebSocketShard.<anonymous> (D:\atermibot\node_modules\@discordjs\ws\dist\index.js:1190:51)
at WebSocketShard.emit (D:\atermibot\node_modules\@vladfrangu\async_event_emitter\dist\index.cjs:287:31)
at WebSocketShard.onMessage (D:\atermibot\node_modules\@discordjs\ws\dist\index.js:1005:14)
Emitted 'error' event on Client instance at:
at emitUnhandledRejectionOrErr (node:events:403:10)
at process.processTicksAndRejections (node:internal/process/task_queues:92:21)

Node.js v22.8.0
node:events:498
throw er; // Unhandled 'error' event
^

ReferenceError: ChannelType is not defined
at Client.<anonymous> (D:\atermibot\index.js:77:34)
at Client.emit (node:events:520:28)
at MessageCreateAction.handle (D:\atermibot\node_modules\discord.js\src\client\actions\MessageCreate.js:28:14)
at module.exports [as MESSAGE_CREATE] (D:\atermibot\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (D:\atermibot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:355:31)
at WebSocketManager.<anonymous> (D:\atermibot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:239:12)
at WebSocketManager.emit (D:\atermibot\node_modules\@vladfrangu\async_event_emitter\dist\index.cjs:287:31)
at WebSocketShard.<anonymous> (D:\atermibot\node_modules\@discordjs\ws\dist\index.js:1190:51)
at WebSocketShard.emit (D:\atermibot\node_modules\@vladfrangu\async_event_emitter\dist\index.cjs:287:31)
at WebSocketShard.onMessage (D:\atermibot\node_modules\@discordjs\ws\dist\index.js:1005:14)
Emitted 'error' event on Client instance at:
at emitUnhandledRejectionOrErr (node:events:403:10)
at process.processTicksAndRejections (node:internal/process/task_queues:92:21)

Node.js v22.8.0
And this is my code. https://sourceb.in/CtN0xI5V3A
6 Replies
d.js toolkit
d.js toolkit3mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by OP
BMmarci1234
BMmarci1234OP3mo ago
Please ping me with the error because I dont understand
treble/luna
treble/luna3mo ago
you indeed did not define it you have to import it
BMmarci1234
BMmarci1234OP3mo ago
Okay let me try. Okay now it sends back but theres a different type of problem that I need help with. So It is about saying anything in dms and Then it asks you different questions in dm in embeds that you can answer with a,b,c,d. But it does: greetings + First -answer- greetings + first + 2nd -answer- greetings + first + 2nd + 3rd -answer- ... so on. I want it to do it: greetings + first -answer- 2nd -answer- 3rd -answer... so on. I need help with it So, I know it is hard, but I want it to send the embeds like this: -user dm's the bot- bot: Áhh... Mr | Ms marcivagyok1! Lássuk, mely házba kerülsz pár rövid kérdéssel! -kérdés 1 embed- -user answers- bot: -question 2 embed- -user answers- bot: -question 3 embed- .... so on. It is now like this: -user dms- bot: Áhh... Mr | Ms marcivagyok1! Lássuk, mely házba kerülsz pár rövid kérdéssel! -kédés 1 embed- -user answers- bot: Áhh... Mr | Ms marcivagyok1! Lássuk, mely házba kerülsz pár rövid kérdéssel! -kérdés 1, kérdés 2 embed- -user answers- bot: Áhh... Mr | Ms marcivagyok1! Lássuk, mely házba kerülsz pár rövid kérdéssel! -kérdés 1, kérdés 2, kérdés 3 embed- ... so on. I hope you will be able to help me Anyone could maybe help me? I am struggling with this
d.js docs
d.js docs3mo ago
:guide: Popular Topics: Collectors - Message collectors read more
Amgelo
Amgelo3mo ago
you can use a collector or await the message like in the guide
Want results from more Discord servers?
Add your server