-
Notifications
You must be signed in to change notification settings - Fork 139
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
feat: user apps #1173
feat: user apps #1173
Conversation
I agree that the naming is weird, and it still may change. But personally I feel like naming things similarly but differently compared to the discord docs could just wind up adding unnecessary confusion to an already murky situation. Especially for people trying to search by specific keywords. |
This should have a way to automatically apply the same context to every single command. Like a bot default_contexts parameter. |
DM Permission requires a bit more work (shouldn't impact user-facing side, should not actually touch the API) but this was the quickest change to make it no longer touch the API |
this ends up not changing the logic
Going to go ahead and merge this now; I'm quite happy with the current state, and it's been long overdue. The only two remaining points are bot-wide defaults for |
Summary
discord/discord-api-docs@1eaa1af :woo:
(+ discord/discord-api-docs@462cddc)
Adds support for all things related to user-installed applications.
Some parts of the API aren't... great. Particularly some of the terminology/naming used is just confusing, and some parts are just completely nontransparent wrt. defaults and fields taking priority over others. It is what it is. /shrug
Issues
A probably non-exhaustive list of things that are still missing, could be improved, or are still uncertain.
API issues/unclear behavior:
contexts
does not default to[0, 1, 2]
on the api side, despite the documentation's claims.Application.install_params
and.integration_types_config
work together. Right now it seems that the latter takes precedence over the former, if set. The dev portal sends both, looks like the API isn't doing any data shuffling here.Same thing goes forApplicationCommand.dm_permission
and.contexts
. I'm not sure if we even want to deprecatedm_permission
right now.dm_permission
; if both are set, we raise an exception. fwiw, if both are sent, the API preferscontexts
overdm_permission
We might want to send a fixed default value forcontexts
instead of the currentnull
, in case the API ever starts choosing for us.Theauthorizing_integration_owners
field is weird, and its structure varies heavily based on configuration/context of commands and interactions. It already has a lengthy docstring, but it might be easier to instead split it into two separate properties and add some of our own fallbacks.AuthorizingIntegrationOwners
class nowmessage.interaction_metadata.name
isn't documented - quote, "well it will still be there, but i dont want to officially document it". It's an optional field, so implementing it nonetheless is probably fine.Bugs/Missing features:
This needs feat(interactions): deserializechannel
from data #1012, feat: deserialize dm/group channels in interactions #1233. Additionally, feat!: use the guild data provided on interactions #1236 for theguild
attribute in guilds without the bot user. And then likely a ton of mocking forguild.me
and several permissions-related methods. Still very uncertain about this part.TheGuildCommandInteraction
annotation (which ends up settingdm_permission=False
) silently conflicts with thecontexts
parameter. See 3.contexts = InteractionContextTypes(guild=True)
instead ofdm_permission = False
QOL:
There are no utility decorators yet (like@commands.default_member_permissions()
).@commands.integration_types
and@commands.contexts
decoratorsAllowing a command e.g. in all contexts is very verbose due tocontexts=[InteractionContextType.guild, ..., ...]
. An.all()
property on the two new enums could be useful, but also feels a bit weird. Might be resolved by 10. eventually..all()
As mentioned, the official naming is weird. "interaction context" vs "installation context"/"integration type" is easy to mix up, and "integration type" in itself just seems... wrong. Considering renaming allintegration_types
toinstallation_types
(the one combination of these words that the api docs don't use!).Interaction.guild
, e.g. in ext.commands checks.TODO
s in the code.Documentation:
The docs page still needs updates.integration_types
andcontexts
, and removed thedm_permission
partChecklist
pdm lint
pdm pyright