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
Copy file name to clipboardExpand all lines: docs/src/Guides/03 Creating Commands.md
+61-10Lines changed: 61 additions & 10 deletions
Display the source diff
Display the rich diff
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