Get content as resolved tags
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!14 Replies
Maybe userMention and channelMention functions? Top level export in v14, under Formatters in v13. You'll need to do some regex parsing I think?
there was something in v12 iirc
idk about 13/14
Solution
There's a .cleanContent variable
Not sure how I missed that but that solves it for me
Oh I guess I misunderstood the question
The wording on the question was a bit rough to be fair, I wasn't sure how to phrase it
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.
Thanks for the heads up, I’ll take a peek at the source code and see if that’s the case
GitHub
discord.js/Util.js at main · discordjs/discord.js
A powerful JavaScript library for interacting with the Discord API - discord.js/Util.js at main · discordjs/discord.js
Yep looks like it only does cached users
btw any specific reason for using
generally, people use it for the
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?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
Answer Overflow
❔ postgres EF core, how to have a custom connection string config f...
C# #help - ❔ postgres EF core, how to have a custom connection string config file
Hey, I have a net6 class library with a DbContext, I want to have the connection string in a separate custom config file, code below.
For some reason, when I do dotnet ef database update, an error pops up:
System.ArgumentException: Couldn't set min pool size (P...
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
Makes sense