auto notification to a channel
node:events:491
throw er; // Unhandled 'error' event
^
TypeError: Cannot read properties of undefined (reading 'id')
at InteractionCollector.filter (/media/rachit/RAVEN/projectAlpha/space/main.js:116:85)
at InteractionCollector.handleCollect (/media/rachit/RAVEN/projectAlpha/node_modules/discord.js/src/structures/interfaces/Collector.js:124:39)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Emitted 'error' event on Client instance at:
at emitUnhandledRejectionOrErr (node:events:394:10)
at process.processTicksAndRejections (node:internal/process/task_queues:84:21)
Node.js v18.13.0
I am trying to make a notification bot which will send embeds with button interaction
source code: https://codefile.io/f/NFp1YXfsgM
Codefile.io
notification bot — Codefile
Create collaborative code files online for your technical interviews, pair programming, teaching, etc.
11 Replies
- 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 OPso when ever I interact with button in discord app it generates the above mentioned error and give the interaction failed error in the app
a channel has no such property as
author
should I remove filter then??
no just channel.
author
how can I make that interaction visible only to the person who pressed it?
set it ephemeral
I have one last doubt can you tell me the syntax to send normal message with embeds
with ephermeral:true
just pass in content and embeds
unless you mean something else
but when i am passing like this only text part is shown not embeds
channel.send("texts",{embed:embed})
embeds* which is also an array
also it should ideally be content: and embeds: