Is there a way to escape the "hide link embed" markdown sequence?
I just checked
escapeMarkdown
. It allows me to escape pretty much all Discord-flavored markdown sequences, except for the "hide link embed" one.
For reference: It's when you put links into angled brackets (<>
), so that links in your message don't automatically embed.
So: does d.js support this anywhere else?
See screenshot for potential use case. This is with all EscapeMarkdownOptions
already set to true
.9 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!- discord.js 14.13.0
- node 18.17.1
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
Alright, thanks for the answer.
Looks like this might need a fix, so I'll open an issue on GH.
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
No, I'm saying that formatters has no way to escape hidden link embeds.
E.g. when I pass the string
<f://g.d>
to the escapedMarkdown()
function, I'd like to get \<<f://g.d>>
.
My specific use case is for when users change their name to something like <https://www.google.com/>
(with angled brackets), see image on original post.
The bot would display that new username. Ideally, it should look like <https://www.google.com/>, rather than just https://www.google.com/ like it does in aforementioned image.Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
It's not just about escape hidden link embeds. I'd like to escape everything that's possible. Codeblocks can't handle backticks as far as I'm aware.
A more extreme example (no way for me to even display this correctly inline):
- Un-escaped, this renders as <f://g.d>
M
\
- Ideally, it should render as ~~***__<<f://g.d>>__***~~||`M`||\\ (Identical to the text in the code block)
- Letting d.js handle it, it renders as ~~***__<f://g.d>__***~~||`M`||\\ (Note the missing angled brackets)Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View