-
Notifications
You must be signed in to change notification settings - Fork 137
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
base: master
Are you sure you want to change the base?
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 |
@shiftinv could you separate the stuff for app info (disnake/appinfo.py, disnake.utils.oauth_url, etc) into a separate pr? Those don't need to be a part of this PR. |
…pe` into flags instead of enums
This reverts commit 93de3c8.
…ommandInteraction` correctly
…with `dm_permission=True, contexts=None`)
this isn't required, but done just to be sure, since the override behavior of the api isn't documented
…w fields on subcommands
Summary
discord/discord-api-docs@1eaa1af :woo:
This is still wip. The current state already works fine, just a few rough edges.
The API isn'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.authorizing_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.message.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:
channel
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:
@commands.default_member_permissions()
).Allowing 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()
integration_types
toinstallation_types
(the one combination of these words that the api docs don't use!).TODO
s in the code.Documentation:
Checklist
pdm lint
pdm pyright