You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error: 'reaction.member.user' is possibly 'undefined'.ts(18048)
Problem: The user property is only omitted in message creates & updates according to the docs. This is guaranteed by the docs, so we could make this more accurate.
Error: Property 'parent_id' does not exist on type 'APIGroupDMChannel'.ts(2339)
Problem: We know the channels returned from GET Guild Channels won't be DM channels.
Error: 'message.member' is possibly 'undefined'.ts(18048)
Problem: Discord's docs guarantee that user-generated messages have a valid member from MESSAGE_CREATE events. Even when we narrow the message to only user-generated messages - as is extremely common for bots - we still don't get any help from the types for stuff like this.
Ideal solution or implementation
Where possible, we can make the types from the REST API and from the gateway more useful by creating and choosing narrower types to provide the most information we can for Typescript.
If this is wanted, I'd be willing to whip up a PR based on derived types I've already written for my app.
Alternative solutions or implementations
No response
Other context
No response
The text was updated successfully, but these errors were encountered:
Feature
There's quite a variety of places where the types are less useful than they could be.
Some examples:
Error:
'reaction.member.user' is possibly 'undefined'.ts(18048)
Problem: The
user
property is only omitted in message creates & updates according to the docs. This is guaranteed by the docs, so we could make this more accurate.Error:
Property 'parent_id' does not exist on type 'APIGroupDMChannel'.ts(2339)
Problem: We know the channels returned from GET Guild Channels won't be DM channels.
Error:
'message.member' is possibly 'undefined'.ts(18048)
Problem: Discord's docs guarantee that user-generated messages have a valid member from
MESSAGE_CREATE
events. Even when we narrow the message to only user-generated messages - as is extremely common for bots - we still don't get any help from the types for stuff like this.Ideal solution or implementation
Where possible, we can make the types from the REST API and from the gateway more useful by creating and choosing narrower types to provide the most information we can for Typescript.
If this is wanted, I'd be willing to whip up a PR based on derived types I've already written for my app.
Alternative solutions or implementations
No response
Other context
No response
The text was updated successfully, but these errors were encountered: