Can‘t find message by id
I can‘t fetch a message by his id.
The error:
const clockInMessage = await user.messages.fetch(worker.clockInMessage);
3|segritude | ^
3|segritude | TypeError: Cannot read properties of undefined (reading 'fetch')
6 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!The user and the message id are correct
A user doesnt have a messages property
you have to call createDM, which returns a channel
Even if some DMs have already been sent?
So it would be?:
Handle the promise
Ah ok, thank you very much