Repository navigation
fix: Align TypedDicts for API objects with the actual API spec #3448
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
ed3ac0a
18d1983
01bfd66
1a60612
62d5ab2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,58 +38,60 @@ | |
| ApplicationEventWebhookStatus = Literal[1, 2, 3] | ||
|
|
||
|
|
||
| class AppInstallParams(TypedDict): | ||
| class ApplicationInstallParams(TypedDict): | ||
| scopes: list[str] | ||
| permissions: str | ||
|
|
||
|
|
||
| class ApplicationIntegrationTypeConfiguration(TypedDict, total=False): | ||
| oauth2_install_params: AppInstallParams | ||
| class ApplicationIntegrationTypeConfiguration(TypedDict): | ||
| oauth2_install_params: ApplicationInstallParams | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Docs lists the |
||
|
|
||
|
|
||
| class BaseAppInfo(TypedDict): | ||
| class ApplicationInfo(TypedDict): | ||
| id: Snowflake | ||
| name: str | ||
| icon: str | None | ||
| description: str | ||
| verify_key: str | ||
|
|
||
| icon: NotRequired[str | None] | ||
| cover_image: NotRequired[str] | ||
| guild_id: NotRequired[Snowflake] | ||
| guild: NotRequired[Guild] | ||
| rpc_origins: NotRequired[list[str]] | ||
| bot_public: bool | ||
| bot_require_code_grant: bool | ||
| bot: NotRequired[PartialUser] | ||
| terms_of_service_url: NotRequired[str] | ||
| privacy_policy_url: NotRequired[str] | ||
| owner: NotRequired[PartialUser] | ||
| team: NotRequired[Team | None] | ||
| rpc_origins: NotRequired[list[str]] | ||
| bot_public: NotRequired[bool] | ||
| bot_require_code_grant: NotRequired[bool] | ||
| terms_of_service_url: NotRequired[str | None] | ||
| privacy_policy_url: NotRequired[str | None] | ||
| verify_key: str | ||
| team: Team | None | ||
| guild_id: NotRequired[Snowflake] | ||
| guild: NotRequired[Guild] | ||
| primary_sku_id: NotRequired[Snowflake] | ||
| slug: NotRequired[str] | ||
| cover_image: NotRequired[str] | ||
| flags: NotRequired[int] | ||
| flags_new: NotRequired[str] | ||
| approximate_guild_count: NotRequired[int] | ||
| approximate_user_install_count: NotRequired[int] | ||
| approximate_user_authorization_count: NotRequired[int] | ||
| redirect_uris: NotRequired[list[str]] | ||
| interactions_endpoint_url: NotRequired[str | None] | ||
| role_connections_verification_url: NotRequired[str | None] | ||
| event_webhooks_url: NotRequired[str | None] | ||
| event_webhooks_status: NotRequired[ApplicationEventWebhookStatus] | ||
| event_webhooks_types: NotRequired[list[str]] | ||
| tags: NotRequired[list[str]] | ||
| install_params: NotRequired[AppInstallParams] | ||
| custom_install_url: NotRequired[str] | ||
| install_params: NotRequired[ApplicationInstallParams] | ||
| integration_types_config: NotRequired[ | ||
| dict[ | ||
| ApplicationIntegrationType, | ||
| ApplicationIntegrationTypeConfiguration | None, | ||
| ] | ||
| ] | ||
| custom_install_url: NotRequired[str] | ||
|
|
||
|
|
||
| class PartialApplicationInfo(TypedDict): | ||
| """Received from the gateway during the READY event.""" | ||
|
|
||
| class AppInfo(BaseAppInfo, total=False): | ||
| primary_sku_id: Snowflake | ||
| slug: str | ||
| id: Snowflake | ||
| flags: int | ||
| approximate_guild_count: int | ||
| approximate_user_install_count: int | ||
| approximate_user_authorization_count: int | ||
| redirect_uris: list[str] | ||
| interactions_endpoint_url: str | None | ||
| role_connections_verification_url: str | None | ||
| event_webhooks_url: str | None | ||
| event_webhooks_status: ApplicationEventWebhookStatus | ||
| event_webhooks_types: list[str] | ||
|
|
||
|
|
||
| class PartialAppInfo(BaseAppInfo, total=False): | ||
| pass | ||
| flags_new: str | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,7 +29,7 @@ | |
|
|
||
| from typing_extensions import NotRequired, TypedDict | ||
|
|
||
| from .appinfo import PartialAppInfo | ||
| from .appinfo import PartialApplicationInfo | ||
| from .channel import PartialChannel | ||
| from .guild import InviteGuild, _GuildPreviewUnique | ||
| from .role import Role | ||
|
|
@@ -62,7 +62,7 @@ class Invite(IncompleteInvite): | |
| scheduled_event: NotRequired[ScheduledEvent] | ||
| target_user: NotRequired[PartialUser] | ||
| target_type: NotRequired[InviteTargetType] | ||
| target_application: NotRequired[PartialAppInfo] | ||
| target_application: NotRequired[PartialApplicationInfo] | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
If I get it correctly, the docs state that |
||
| roles: NotRequired[list[Role]] | ||
|
|
||
|
|
||
|
|
@@ -75,7 +75,7 @@ class GatewayInviteCreate(TypedDict): | |
| inviter: NotRequired[PartialUser] | ||
| target_type: NotRequired[InviteTargetType] | ||
| target_user: NotRequired[PartialUser] | ||
| target_application: NotRequired[PartialAppInfo] | ||
| target_application: NotRequired[PartialApplicationInfo] | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here. It's clearly not only limited to |
||
| channel_id: Snowflake | ||
| code: str | ||
| created_at: str | ||
|
|
||

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
discord.activity:L590anddiscord.activity:L859still tend to you thesession_id, should be dropped.