You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add support for user-installable apps (#1647)
* [feat] Initial UserApps support
* fix: use factory instead of default
* fix: properly process and sync contexts and integration_types
* fix: correct typehints of new fields
* feat: add integration_types and contexts to decorators
* fix: might as well
* feat: add context and authorizing_integration_owners fields to context
* feat: add interaction_metadata to Message
* fix: presumably would be an issue here
* fix: export MessageInteractionMetadata
* feat: lazly add integration_types_config
* feat: hybrid ctx parity
* docs: add comments for hybrid ctx channel types
* fix: add new enums to __all__
* ci: make pre-commit not complain
* fix: properly handle integration_types and contexts for subcommands
* feat: add contexts and integration_types decorators
Not sure how I feel about the names.
* docs: add basic docs for contexts/integration_types
* fix: do not compare contexts when guild cmd
* refactor: use less hacky logic for dm_permission
* fix: make hybrid cmd use prefixed channel when possible
* feat: add integration_types/contexts parity for hybrid cmds
* refactor: just use already-determined context
* fix: parse and use new user field for MessageInteractionMetadata
* fix: add custom context logic if context is empty
---------
Co-authored-by: zevaryx <[email protected]>
Copy file name to clipboardExpand all lines: docs/src/Guides/03 Creating Commands.md
+61-10
Original file line number
Diff line number
Diff line change
@@ -423,18 +423,69 @@ There are two ways to define permissions.
423
423
424
424
Multiple permissions are defined with the bitwise OR operator `|`.
425
425
426
-
### Blocking Commands in DMs
426
+
##Usable Contexts
427
427
428
-
You can also block commands in DMs. To do that, just set `dm_permission` to false.
428
+
You can control where slash commands (and other application commands) can be used using - in guilds, in DMs, and/or other private channels. By default, commands can be used in all contexts.
429
429
430
-
```py
431
-
@slash_command(
432
-
name="my_guild_only_command",
433
-
dm_permission=False,
434
-
)
435
-
asyncdefmy_command_function(ctx: SlashContext):
436
-
...
437
-
```
430
+
As with permissions, there are two ways to define the context.
Applications can be installed/integrated in different ways:
459
+
- The one you are familiar with is the *guild* integration, where the application is installed in a specific guild, and so the entire guild can use the application.
460
+
- You can also install the application to a *user*, where the application can then be used by the user anywhere they desire.
461
+
462
+
By default, commands can only be used in guild integrations. Like many other properties, this can be changed.
0 commit comments