Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type currently unknown toJSON() methods #9432

Open
papsavas opened this issue Apr 20, 2023 · 0 comments
Open

Type currently unknown toJSON() methods #9432

papsavas opened this issue Apr 20, 2023 · 0 comments

Comments

@papsavas
Copy link
Contributor

papsavas commented Apr 20, 2023

Which package is this feature request for?

discord.js

Feature

Right now there are some structures (Guild, Application, Client, GuildMember etc...) where their JSON type is marked as unknown. This makes it frustrating when you need to provide them to external JSON sources with their respective types

Ideal solution or implementation

An internal JSON type that flattens all required fields accordingly and replaces current toJSON() marked as unknown

Alternative solutions or implementations

A public JSON<T> type helper (such as this) that receives a generic and Flattens it accordingly.

Other context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants