Skip to content
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

Merged
merged 75 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
92f19f5
feat(types): update/add new fields to `disnake.types`
shiftinv Mar 20, 2024
6180560
fix(types): probably resolve todos, these fields don't exist in guild…
shiftinv Mar 20, 2024
8589cbb
feat: add new fields to app command models
shiftinv Mar 20, 2024
83661e7
feat: add new fields in interactions
shiftinv Mar 20, 2024
ea29a35
docs: add interaction fields documentation that may or may not be her…
shiftinv Mar 21, 2024
dca356e
refactor: deprecate `InteractionReference`
shiftinv Mar 22, 2024
ca755ee
feat(message): add `InteractionMetadata`
shiftinv Mar 22, 2024
5ab5940
feat(appinfo): add `IntegrationTypeConfiguration`
shiftinv Mar 22, 2024
450d279
feat: add `integration_type=` parameter to oauth urls
shiftinv Mar 22, 2024
745b161
fix: match api default for `integration_types` to avoid unnecessary sync
shiftinv Mar 23, 2024
545268b
feat(commands): add new parameters to ext.commands
shiftinv Mar 23, 2024
a3736c2
docs: add changelog entry
shiftinv Mar 23, 2024
a33c95d
fix(types): update `interaction_metadata.name` type
shiftinv Mar 23, 2024
2291ad1
Merge remote-tracking branch 'upstream/master' into feature/user-apps-v2
shiftinv Aug 19, 2024
c06f9c3
fix: add `InteractionMetadata.user`
shiftinv Aug 19, 2024
10a8bbb
chore: remove weird `int(dict.get())` call
shiftinv Aug 20, 2024
79b0ca3
Merge remote-tracking branch 'upstream/master' into feature/user-apps-v2
shiftinv Aug 24, 2024
93de3c8
fix: make dm_permission a property
onerandomusername Sep 23, 2024
8116d02
Merge branch 'master' into feature/user-apps-v2
shiftinv Sep 23, 2024
fa87500
refactor: turn `ApplicationIntegrationType` and `InteractionContextTy…
shiftinv Sep 16, 2024
312277e
refactor: change `oauth_url` `integration_type` default to `MISSING`
shiftinv Sep 16, 2024
b7f5cde
test: update `oauth_url` test
shiftinv Sep 16, 2024
0596bee
feat(flags): add `.all()` classmethod to new flag types
shiftinv Sep 16, 2024
03d879d
refactor: pluralize flag class names
shiftinv Sep 29, 2024
77ccd42
fix(docs): a/an grammar stuff in flags
shiftinv Sep 29, 2024
ef18d85
chore: yet another smol todo
shiftinv Sep 29, 2024
2b0ab7a
revert: "fix: make dm_permission a property"
shiftinv Sep 29, 2024
d1ed175
refactor: turn `dm_permission` into `contexts.bot_dm`, handle `GuildC…
shiftinv Sep 30, 2024
4f50433
fix(docs): fix references in ext.commands
shiftinv Sep 30, 2024
5cef0f9
fix: avoid resync for old commands with default settings (i.e. those …
shiftinv Sep 30, 2024
34b97ae
refactor: keep `dm_permission` and `contexts` completely separate
shiftinv Oct 1, 2024
009f787
fix: change `__eq__` to ignore `dm_permission` if `contexts` is set
shiftinv Oct 1, 2024
8321403
fix: don't send `dm_permission` if `contexts` is set
shiftinv Oct 1, 2024
bef05ec
feat: raise error if both parameters are set
shiftinv Oct 1, 2024
eabb563
feat: show `dm_permission` warning in user code (3.12+)
shiftinv Oct 1, 2024
c4885c4
fix: update `default_permission` error text
shiftinv Oct 1, 2024
fbd95c8
fix: make `GuildCommandInteraction` always overwrite contexts
shiftinv Oct 1, 2024
3ca6790
feat: provide (hopefully) helpful error message when trying to set ne…
shiftinv Oct 1, 2024
ad2fb7c
fix(docs): remove duplicate `dm_permission` documentation
shiftinv Oct 1, 2024
c76c9d3
Merge remote-tracking branch 'upstream/master' into feature/user-apps-v2
shiftinv Nov 14, 2024
c7a176b
Merge remote-tracking branch 'upstream/master' into feature/user-apps-v2
shiftinv Nov 25, 2024
c2ee995
feat: add `InteractionMetadata.target_user`/`.target_message_id`
shiftinv Nov 25, 2024
746f104
fix: remove undocumented `interaction_metadata.name` again
shiftinv Nov 25, 2024
12dcc38
fix: don't store users in `InteractionMetadata`
shiftinv Nov 25, 2024
df0e575
fix: remove unused `InteractionMetadata._state`
shiftinv Nov 25, 2024
54a7f45
chore: `__slots__` should be a tuple
shiftinv Nov 25, 2024
3caa3dc
refactor: move `authorizing_integration_owners` data into new separat…
shiftinv Nov 25, 2024
29f602f
docs: simplify `target_user`/`target_message_id` description
shiftinv Nov 25, 2024
79e6d3c
fix(docs): don't show constructor parameters for message-related models
shiftinv Nov 25, 2024
23bc05e
refactor: expose `AppInfo.integration_types_config` through propertie…
shiftinv Nov 26, 2024
091ef9d
chore: remove some obsolete todos
shiftinv Nov 26, 2024
f37e8c8
Merge remote-tracking branch 'upstream/master'
shiftinv Nov 26, 2024
21b0bed
feat: add `integration_types` and `contexts` decorators
shiftinv Nov 26, 2024
78d7b91
fix(docs): move decorators to app_commands.rst
shiftinv Nov 26, 2024
29bd3dc
fix: remove unnecessary check in `_ensure_assignment_on_copy`
shiftinv Nov 26, 2024
5ed766f
chore: fix unrelated `__repr_info__` typo
shiftinv Nov 26, 2024
2f8eecb
fix: handle `integration_types`/`contexts` in `*_command_attrs` corre…
shiftinv Nov 26, 2024
1e4c7e5
fix: restore `integration_types` default for sync only
shiftinv Nov 26, 2024
ccd89f0
fix: ignore `contexts` decorator if `GuildCommandInteraction` is used
shiftinv Nov 26, 2024
307a441
fix: copy flag values in commands, just to be sure
shiftinv Nov 26, 2024
0ee644d
chore: update some docs re: `Interaction.guild`, update TODOs
shiftinv Nov 27, 2024
1d949f6
feat: also set `integration_types` if `GuildCommandInteraction` is used
shiftinv Nov 27, 2024
4b87ff5
docs: specifically list attributes with changed annotations in intera…
shiftinv Nov 27, 2024
b02635d
docs: update `Interaction.context` description
shiftinv Nov 27, 2024
07e6853
feat: make `Interaction.context` non-optional
shiftinv Nov 27, 2024
fbab8cc
feat: use `_app_permissions` in (g)dm contexts as well
shiftinv Nov 27, 2024
20f5ee6
docs: update slash commands guide page
shiftinv Nov 28, 2024
8154d90
docs: link to new guide section from decorator docstrings
shiftinv Nov 28, 2024
6e04667
fix: also raise if `contexts` decorator is used with `dm_permission`
shiftinv Nov 28, 2024
432ca57
docs: add changelog entries
shiftinv Nov 28, 2024
10279d0
Merge remote-tracking branch 'upstream/master' into feature/user-apps-v2
shiftinv Dec 13, 2024
ae73577
Merge remote-tracking branch 'upstream/master'
shiftinv Dec 13, 2024
44cb10b
refactor: "integration type" -> "install type"
shiftinv Dec 13, 2024
a5ea89e
feat: throw error for `integration_types`
shiftinv Dec 13, 2024
e0a32e1
chore: remove last todo
shiftinv Dec 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/1173.deprecate.0.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Deprecate :attr:`ApplicationCommand.dm_permission` and related fields/parameters of application command objects. Use ``contexts`` instead.
1 change: 1 addition & 0 deletions changelog/1173.deprecate.1.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Deprecate :attr:`Message.interaction` attribute and :class:`InteractionReference`. Use :attr:`Message.interaction_metadata` instead.
13 changes: 13 additions & 0 deletions changelog/1173.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Add support for user-installed commands. See :ref:`app_command_contexts` for further details.
- Add :attr:`ApplicationCommand.install_types` and :attr:`ApplicationCommand.contexts` fields,
with respective :class:`ApplicationInstallTypes` and :class:`InteractionContextTypes` flag types.
- :class:`Interaction` changes:
- Add :attr:`Interaction.context` field, reflecting the context in which the interaction occurred.
- Add :attr:`Interaction.authorizing_integration_owners` field and :class:`AuthorizingIntegrationOwners` class, containing details about the application installation.
- :attr:`Interaction.app_permissions` is now always provided by Discord.
- Add :attr:`Message.interaction_metadata` and :class:`InteractionMetadata` type, containing metadata for the interaction associated with a message.
- Add ``integration_type`` parameter to :func:`utils.oauth_url`.
- Add :attr:`AppInfo.guild_install_type_config` and :attr:`AppInfo.user_install_type_config` fields.
- |commands| Add ``install_types`` and ``contexts`` parameters to application command decorators.
- |commands| Add :func:`~ext.commands.install_types` and :func:`~ext.commands.contexts` decorators.
- |commands| Using the :class:`GuildCommandInteraction` annotation now sets :attr:`~ApplicationCommand.install_types` and :attr:`~ApplicationCommand.contexts`, instead of :attr:`~ApplicationCommand.dm_permission`.
Loading
Loading