Question on user caching in bot messages
I'm testing making a bot send a message when a user joins and leaves the guild. The message contains a mention of the user. This is basically what I originally wrote:
However, the messages would sometimes show the mention as
@unknown-user until you viewed their profile through something like Mod-View.
Would changing this to use allowedMentions: { users: [member.id] } fix this or is this unavoidable? If yes to the prior, can the issue still occur when the user leaves the guild?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!
- ✅ Marked as resolved by OPThat's how discord protects your privacy.
Checkout this user <@186330752437190658>
For me it shows the name etc. But for u it's probably unknown user (except if you have indirect contact to him eg. by sharing a server)

but this is about joinijg
so it's in the server
it's probably about the caching not being updated 🤷🏿♂️
using allowedmentions should work since cv2 can mention users (they are included in the payload and get cached). Though i don't know if they are included by default or with allowedmentions set
Got it thanks 👍