discordjs / builders

A collection of builders that you can use when creating your bot.
Apache License 2.0
97 stars 37 forks source link

Add Builder#toData #38

Closed suneettipirneni closed 2 years ago

suneettipirneni commented 2 years ago

Is your feature request related to a problem? Please describe. A handful of users have had complaints of builders not being directly compatible with djs methods. This is because this library uses api-types which is expected and somewhat intended.

Describe the ideal solution

Instead I'm proposing we introduce Builder#toData. This is basically just like toJSON but instead gives you the djs *Data equivalent type. This allows the builders to be used with djs, and not require any implementation changes in djs.

Describe alternatives you've considered

Some of have brought up the solution of allowing djs methods to accept both api-types and djs data. However as others have stated this seems out of place for the djs library.

Refs: #37 #32 Willing to submit PR