[TS] message member is possibly null
making something that uses
message.member
to check permissions of a user
npm v.9.6.7
node v.18.3.0
discord.js v14.11.08 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!Use author instead, that property always exist on newly received messages.
the 2nd screenshot is when the function is specifically using message.user
Now this function, whatever it actually is doing, wants a member, giving it a user won't work.
If this really requires a member, you might want to fetch the member in case it's missing.
Note that webhook messages do not come with one and you won't be able to fetch one.
Unknown User•16mo ago
Message Not Public
Sign In & Join Server To View
Unknown User•16mo ago
Message Not Public
Sign In & Join Server To View