channelPinsUpdate get the pinned/unpinned message
I'm trying to get the most recently pinned or unpinned message from the channelPinsUpdate event. The event returns a channel and a date.
You can get all pinned messages by using
channel.messages.fetchPinned()
It's not possible to know if a message was pinned or unpinned since the date is always provided.
The message class has no property for when it was pinned, so you can't go through all pinned messages and then find the one that matches the date that's given to you...
Is there any other way to actually get that one message that just got pinned or unpinned?11 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!I guess I will just have to use messageUpdate in the meantime to check whenever a message gets pinned
you can fetch audit logs and check there
though messageUpdate is probably better/easier for your case
:bcaYaya3:
people generally use audit logs when they need to know who performed an action, or if somehow there's no other way
What's the channelPinsUpdate event even for if it only gives you a useless date and a channel
Why does it not just give you the message so it's actually useful?
I see no use case to ever need just the channel when a message gets pinned
Welp, just got the answer to the second question
for you to get messageUpdate, you need the GuildMessages intent, maybe you also need a partial though I'm not sure of that
there may be people that do only need the channel for some reason, maybe logging or whatever
otherwise ask discord ig lol
oh I know how to do all of that
I will do that
is it okay to leave this post open so I can give updates on it?
I'm not sure since this is more for djs related questions, maybe staff can answer
I sent a mail directly to their Developer Support in the help center
So I got a response and they basically just told me to post a feature request on the discord-api-docs github page which are read by the discord API engineers