Get content as resolved tags

RRhys1/23/2023
Couldn't figure out how to title it, but I'd like to take a message like

hey @<213123123> look in channel <#1037547185492996208> and get that as it's resolved version so like hey joe look in channel #updog - Is there a DiscordJS function to do that? Thanks!
FFavna1/23/2023
Maybe userMention and channelMention functions? Top level export in v14, under Formatters in v13. You'll need to do some regex parsing I think?
KKrish1/23/2023
there was something in v12 iirc
idk about 13/14
Solution
RRhys1/23/2023
There's a .cleanContent variable :pog:
RRhys1/23/2023
Not sure how I missed that but that solves it for me
FFavna1/23/2023
Oh I guess I misunderstood the question
RRhys1/23/2023
The wording on the question was a bit rough to be fair, I wasn't sure how to phrase it
BBen8551/23/2023
Just an FYI, I know that relied on the cache in v12 and would occasionally not get usernames. I’m not sure if that’s changed since.
RRhys1/23/2023
Thanks for the heads up, I’ll take a peek at the source code and see if that’s the case
RRhys1/24/2023
Yep looks like it only does cached users
KKrish1/25/2023
btw any specific reason for using cleanContent?
generally, people use it for the repeat command, if your use case is similar then why don't you use disable mentions with the allowedMentions option?
RRhys1/25/2023
Not sure what the repeat command is but im using it to fix the bug seen on this page for example where it’s mentioning the ID instead of the user https://www.answeroverflow.com/m/1051157842893221918
RRhys1/25/2023
Technically it’d be better to keep it in that format and parse it into the mentions on the server before sending it to the page but for now this approach should work
KKrish1/25/2023
Makes sense