Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
discord/discord-api-docs@1eaa1af :woo:
This is still wip. The current state already works fine, just lots of 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.ApplicationCommand.dm_permission
and.contexts
. I'm not sure if we even want to deprecatedm_permission
right now.contexts
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, a new implementation of feat!: provide guild objects in interactions when guild is uncached #647, and another branch I haven't PR'd yet, to be usable properly 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.GuildCommandInteraction
annotation (which ends up settingdm_permission=False
) silently conflicts with thecontexts
parameter. See 3.QOL:
@commands.default_member_permissions()
).contexts=[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.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