NKN1396
DIAdiscord.js - Imagine an app
•Created by NKN1396 on 9/23/2023 in #djs-questions
Is there a way to escape the "hide link embed" markdown sequence?
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)14 replies
DIAdiscord.js - Imagine an app
•Created by NKN1396 on 9/23/2023 in #djs-questions
Is there a way to escape the "hide link embed" markdown sequence?
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.
14 replies
DIAdiscord.js - Imagine an app
•Created by NKN1396 on 9/23/2023 in #djs-questions
Is there a way to escape the "hide link embed" markdown sequence?
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.14 replies
DIAdiscord.js - Imagine an app
•Created by NKN1396 on 9/23/2023 in #djs-questions
Is there a way to escape the "hide link embed" markdown sequence?
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>>
.14 replies
DIAdiscord.js - Imagine an app
•Created by NKN1396 on 9/23/2023 in #djs-questions
Is there a way to escape the "hide link embed" markdown sequence?
Looks like this might need a fix, so I'll open an issue on GH.
14 replies
DIAdiscord.js - Imagine an app
•Created by NKN1396 on 9/23/2023 in #djs-questions
Is there a way to escape the "hide link embed" markdown sequence?
Alright, thanks for the answer.
14 replies
DIAdiscord.js - Imagine an app
•Created by NKN1396 on 9/23/2023 in #djs-questions
Is there a way to escape the "hide link embed" markdown sequence?
- discord.js 14.13.0
- node 18.17.1
14 replies
DIAdiscord.js - Imagine an app
•Created by NKN1396 on 9/13/2023 in #djs-questions
Incorrect typings for `.toString()` in partials?
I’m already working on a fix. It’s almost done, but I’m still wrestling the build toolchain as my tests keep failing.
33 replies
DIAdiscord.js - Imagine an app
•Created by NKN1396 on 9/13/2023 in #djs-questions
Incorrect typings for `.toString()` in partials?
33 replies
DIAdiscord.js - Imagine an app
•Created by NKN1396 on 9/13/2023 in #djs-questions
Incorrect typings for `.toString()` in partials?
Is someone already looking into this, or should I open an issue on GH?
33 replies
DIAdiscord.js - Imagine an app
•Created by NKN1396 on 9/13/2023 in #djs-questions
Incorrect typings for `.toString()` in partials?
Oh,
Partialize
sounds familiar.
I was looking into the typings yesterday, seeing if I could fix the issue and it absolutely baffled me.
That is, because it's WAY above my TS expertise and I couldn't understand a single thing.
And it certainly didn't help that the 3 generic type names N
, M
and E
were non-descriptive.33 replies
DIAdiscord.js - Imagine an app
•Created by NKN1396 on 9/13/2023 in #djs-questions
Incorrect typings for `.toString()` in partials?
5.2.2
33 replies
DIAdiscord.js - Imagine an app
•Created by NKN1396 on 9/13/2023 in #djs-questions
Incorrect typings for `.toString()` in partials?
Yeah, TypeScript seems to be fine. I think it assumes Node will implicitly add
.toString()
to all objects.
It's only getting caught by ESLint (or more specifically the plugin typescript-eslint
) with the strict-type-checked
configuration (plugin:@typescript-eslint/strict-type-checked
).33 replies
DIAdiscord.js - Imagine an app
•Created by NKN1396 on 9/13/2023 in #djs-questions
Incorrect typings for `.toString()` in partials?
Alright. Thanks for taking your time, by the way.
33 replies
DIAdiscord.js - Imagine an app
•Created by NKN1396 on 9/13/2023 in #djs-questions
Incorrect typings for `.toString()` in partials?
I mean, that'd be a workaround, but it still wouldn't change the fact that this causes TypeScript to throw an error for no good reason.
Looking at the d.js code, I don't see how
<PartialGuildMember>.toString()
could ever evaluate to "[object Object]"
in practice.
I believe the interface PartialGuildMember extends Partialize<>
part in line 6131 of the typings are at fault here.
Ideally, toString()
should not be axed during the "partialization".
However, I'm not 100% certain if this is intended behavior (and I'm missing something). Otherwise I'd have started a PR or maybe even attempted a fix myself already.33 replies
DIAdiscord.js - Imagine an app
•Created by NKN1396 on 9/13/2023 in #djs-questions
Incorrect typings for `.toString()` in partials?
Yup, I do use the GuildMember partial on client creation.
33 replies
DIAdiscord.js - Imagine an app
•Created by NKN1396 on 9/13/2023 in #djs-questions
Incorrect typings for `.toString()` in partials?
I thought clicking the "solved" button would mean I solved the questionnaire I got from the bot 🤣
33 replies
DIAdiscord.js - Imagine an app
•Created by NKN1396 on 9/13/2023 in #djs-questions
Incorrect typings for `.toString()` in partials?
Thank you for reopening!
33 replies
DIAdiscord.js - Imagine an app
•Created by NKN1396 on 9/13/2023 in #djs-questions
Incorrect typings for `.toString()` in partials?
-
discord.js 14.13.0
& node 18.17.1
- It's a discord.js issue
- No error stack trace, this is about typings
- Code: Repo Line 22. Added Line 45 to illustrate the issue.33 replies
DIAdiscord.js - Imagine an app
•Created by NKN1396 on 9/13/2023 in #djs-questions
Incorrect typings for `.toString()` in partials?
Yeah, that. TypeScript forces me to use it (for good reasons I suppose, unless I got something fundamentally wrong).
33 replies