-
-
Notifications
You must be signed in to change notification settings - Fork 94
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
Implement user installations #1952
base: master
Are you sure you want to change the base?
Conversation
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.
Nice PR, I would be happy to merge it in its current state, but its missing a couple of things to have the full spec of user installations:
-
app_permissions
is no longer optional. The typehint should be updated to reflect this, as well as the deserialization - Interaction models have two new fields (both found here):
authorizing_integration_owners
andcontext
- New interaction installation fields config is missing.
- Messages will now contain
interaction_metadata
if they were created by an interaction followup. Its fields can be found here
(I might be missing more, so please have a look at the changelog
Again, thanks a lot for opening the pull request and working on this. Sorry it took so long to review 😔 |
I add other things tomorrow |
(and sorry for shitty commits like the last one) |
okay I'm lied, it's today |
I might be missing something, but I'm not sure what I'm doing anymore))) |
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.
Also, modules should export in the __all__
what you added :)
application_models.ApplicationIntegrationType, application_models.ApplicationInstallParameters | ||
] | ||
] = {} | ||
if (integration_types_config_payload := payload.get("integration_types_config")) is not None: |
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.
if (integration_types_config_payload := payload.get("integration_types_config")) is not None: | |
if integration_types_config_payload := payload.get("integration_types_config"): |
authorizing_integration_owners: typing.Mapping[ | ||
application_models.ApplicationIntegrationType, snowflakes.Snowflake | ||
] = {} | ||
if (authorizing_integration_owners_payload := payload.get("authorizing_integration_owners")) is not None: |
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.
if (authorizing_integration_owners_payload := payload.get("authorizing_integration_owners")) is not None: | |
if authorizing_integration_owners_payload := payload.get("authorizing_integration_owners"): |
registered_guild_id=snowflakes.Snowflake(data_payload["guild_id"]) if "guild_id" in data_payload else None, | ||
entitlements=entitlements, | ||
authorizing_integration_owners=payload["authorizing_integration_owners"], |
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.
Shouldnt this be deserialized as a mapping of ApplicationIntegrationType
to Snowflake
?
@@ -2622,6 +2692,8 @@ def deserialize_autocomplete_interaction( | |||
guild_locale=locales.Locale(payload["guild_locale"]) if "guild_locale" in payload else None, | |||
registered_guild_id=snowflakes.Snowflake(data_payload["guild_id"]) if "guild_id" in data_payload else None, | |||
entitlements=[self.deserialize_entitlement(entitlement) for entitlement in payload.get("entitlements", ())], | |||
authorizing_integration_owners=payload["authorizing_integration_owners"], |
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.
Dito above
@@ -2622,6 +2692,8 @@ def deserialize_autocomplete_interaction( | |||
guild_locale=locales.Locale(payload["guild_locale"]) if "guild_locale" in payload else None, | |||
registered_guild_id=snowflakes.Snowflake(data_payload["guild_id"]) if "guild_id" in data_payload else None, | |||
entitlements=[self.deserialize_entitlement(entitlement) for entitlement in payload.get("entitlements", ())], | |||
authorizing_integration_owners=payload["authorizing_integration_owners"], | |||
context=payload.get("context"), |
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.
I feel like there is a cast missing here
authorizing_integration_owners: typing.Mapping[ | ||
application_models.ApplicationIntegrationType, snowflakes.Snowflake | ||
] = {} | ||
if (authorizing_integration_owners_payload := payload.get("authorizing_integration_owners")) is not None: |
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.
if (authorizing_integration_owners_payload := payload.get("authorizing_integration_owners")) is not None: | |
if authorizing_integration_owners_payload := payload.get("authorizing_integration_owners"): |
Summary
Checklist
nox
and all the pipelines have passed.Related issues