TypeError: Cannot read properties of undefined (reading '_add') on InteractionWebhook.send() call

I have been getting this error randomly for some time
TypeError: Cannot read properties of undefined (reading '_add')
at InteractionWebhook.send (/root/skyhelper/node_modules/discord.js/src/structures/Webhook.js:232:66)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.execute (file:///root/skyhelper/dist/src/commands/slash/info/daily-quests.js:17:19)
at async interactionHandler (file:///root/skyhelper/dist/src/events/interactionCreate.js:33:13)
TypeError: Cannot read properties of undefined (reading '_add')
at InteractionWebhook.send (/root/skyhelper/node_modules/discord.js/src/structures/Webhook.js:232:66)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.execute (file:///root/skyhelper/dist/src/commands/slash/info/daily-quests.js:17:19)
at async interactionHandler (file:///root/skyhelper/dist/src/events/interactionCreate.js:33:13)
Happens when using slash commands At first, I thought maybe it was because the command was used in an uncached channel (as an user app), but looking at the source here https://github.com/discordjs/discord.js/blob/main/packages%2Fdiscord.js%2Fsrc%2Fstructures%2FWebhook.js#L232, the optional chaining (?) should short circuit, also it's actually messages property that's undefined, which confuses me. Because from my understanding, the channel returned shoukd be a TextChannel since slash commands can only be used in those (right ?). So I have no idea what channel type it's getting there. I tried to reproduce this multiple times myself with no avail, it only happens sometimes rarely
2 Replies
d.js toolkit
d.js toolkit•3mo 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
NyR
NyR•3mo ago
sure give me a moment https://sourceb.in/aDOUQjfUAy it's both ok yeah i tried, and you are totally correct, but djs should probably do something about it I have no good answers to why i am not using editReply lol, i'll change it around, also i should probably close this then?
Want results from more Discord servers?
Add your server