NyR
DIAdiscord.js - Imagine an app
•Created by NyR on 7/25/2024 in #djs-questions
TypeError: Cannot read properties of undefined (reading '_add') on InteractionWebhook.send() call
I have been getting this error randomly for some time
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 rarely7 replies