discord.js
discord.js copied to clipboard
types(ModalSubmitFields): components is an array
Please describe the changes this PR makes and why it should be merged:
This PR simply fixes an issue in ModalSubmitFields#components as it wasn't marked as an array and instead was simply an action row
Status and versioning classification:
- Code changes have been tested against the Discord API, or there are no code changes
- I know how to update typings and have done so, or typings don't need updating
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Oh cool you're using teams now, just fyi github only officially assigns 2 members of the team at a time despite you all appearing on the side
I didn't notice but yeah the type is wrong however I don't think that one is right either because that one technically indicates that you can chain components.components infinitely, despite the actual TextInputComponent object coming with a components property set to undefined. Should I just use that type and ignore this?
The types should match what the JS code is, unless the JS code is somehow wrong and has been for a year.
The only thing "wrong" about the JS code is the fact that components is set as undefined on text input objects. I'll try to modify the types a little to match that
Also I know how to fix that issue, can I include that in this PR?
Pushed both the types change and a small change to the transformComponent function that should get rid of all the undefined properties to align it with the data returned by the API and the TS types. If you want me to remove that commit or move it to a different PR lmk