message.channel in DM's is null, is there a way to fill it?
As the title suggests the api doesn't send the channel in the payload for DM messages. Is there a way to fetch the channel so it isn't null in the message object?
16 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.Also, note, I understand you can fetch the channel with the id, but this does not update the existing message object, and you can't set it since channel is read only
If you have the Channel partial enabled you should be getting the partials
Otherwise I'm surprised you're getting the event at all
im sending the message and then I try and do
message.channel
Oh so it's the bots message in the DM?
correct
Hmm
But then... where are you sending it to? The user?
The user is setting up some information and I send a couple modals they can respond to
I'm not sure why you need it populated on message, but try this
Not sure why it's not being put in the cache
I don't necessarily need it, but I have a seperate package to make collectors easier, and it takes in a message object, and then uses
message.channel
so I was looking for a way to populate it instead of doing a PR for the packageDoes that package use the same client?
Yea
message.channel is a getter I think, it just retrieves it from cache
oh
that's very nice, let me try and fetch it
This is correct, thanks!