Bad typings

export type RESTPutAPIGuildMemberResult = APIGuildMember | never;
export type RESTPutAPIGuildMemberResult = APIGuildMember | never;
must be
export type RESTPutAPIGuildMemberResult = APIGuildMember | undefined;
export type RESTPutAPIGuildMemberResult = APIGuildMember | undefined;
7 Replies
d.js toolkit
d.js toolkit17mo ago
- 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!
thegoat
thegoatOP17mo ago
in discord-api-types
Syjalo
Syjalo17mo ago
In discord-api-types never means an HTTP 204 response. As you can see in the docs it can respond with that. undefined will be used if the response is undefined. 204 is nothing at all which in TypeScript never is.
Socram09
Socram0917mo ago
The definition of never for discord-api-types cannot override the utility it has in TypeScript, the result of a union with never will always return the defined type, thus causing confusion for the developer, which should be avoided. shrug
Syjalo
Syjalo17mo ago
You can create an issue on GitHub if you have a suggestion by what to replace never
bludgeoning.angel
It should be X | undefined as never has no effect I'm concerned about this
Want results from more Discord servers?
Add your server