Problem
The discord/types module has several issues that need to be addressed:
- Outdated types: Some type definitions are not up to date with the Discord API
- Insufficient use of inheritance: Types don't leverage inheritance as much as they should
- General messiness: The types module is often messy and hard to navigate
- Naming confusion: Currently, we import types like
from types import X as XPayload, which creates confusion about what classes actually represent
Proposed Solution
- Clean up and update outdated type definitions
- Refactor types to better use inheritance where appropriate
- Improve naming convention: Instead of
import X from types as XPayload, directly name them as XPayload in the types module itself
- This would make it clearer what a class actually represents and reduce confusion
Context
This was discussed as part of the next refactor planning.
Reference: https://canary.discord.com/channels/881207955029110855/1401527338470084819/1440705381901799504
Problem
The
discord/typesmodule has several issues that need to be addressed:from types import X as XPayload, which creates confusion about what classes actually representProposed Solution
import X from types as XPayload, directly name them asXPayloadin the types module itselfContext
This was discussed as part of the next refactor planning.
Reference: https://canary.discord.com/channels/881207955029110855/1401527338470084819/1440705381901799504