Adjust player type in MoonlinkManager

Hey there, I'm taking a look at the new typescript changes. They're pretty decent so far, good enough for what I need. However, the property players under MoonlinkManager is just listed as type object which means it's missing all of its Map properties as well as the create property. I suggest you change its type from get players(): object to get players(): Map<string, MoonlinkPlayer> & { create(data: any) }; This should allow it to pick up on Map properties as well as the custom create function. I would recommend specifying what data looks like overall in the project so we don't get errors of wrong data types inputted but overall I think this should be fine as a bandaid fix. Additionally, it would be nice to use the types from the discord-api-types library (https://github.com/discordjs/discord-api-types) for types such as VoiceServer and VoiceState rather than creating custom ones but that's just an extra suggestion. I'm suggesting this because it's the most widely used library for typings in discord.
GitHub
GitHub - discordjs/discord-api-types: Up to date Discord API Typing...
Up to date Discord API Typings, versioned by the API version - GitHub - discordjs/discord-api-types: Up to date Discord API Typings, versioned by the API version
1 Reply
1Lucas1.apk
1Lucas1.apk•2y ago
Thanks for the suggestion, it will be applied in the next update, I won't be able to do it now after I'm updating the documentation

Did you find this page helpful?