Browse Source

docs?

pull/2531/head
Misha133 2 years ago
parent
commit
d099358ee6
2 changed files with 11 additions and 0 deletions
  1. +5
    -0
      docs/guides/int_framework/permissions.md
  2. +6
    -0
      docs/guides/int_framework/samples/permissions/nsfw-permissions.cs

+ 5
- 0
docs/guides/int_framework/permissions.md View File

@@ -55,5 +55,10 @@ The amount of nesting you can do is realistically endless.
> If the nested class is marked with `Group`, as required for setting up subcommands, this example will not work.
> As mentioned before, subcommands cannot have seperate permissions from the top level command.

### NSFW Commands
Commands can be limited to only age restricted channels and DMs:

[!code-csharp[Nsfw-Permissions](samples/permissions/nsfw-permissions.cs)]

[permissions]: xref:Discord.GuildPermission


+ 6
- 0
docs/guides/int_framework/samples/permissions/nsfw-permissions.cs View File

@@ -0,0 +1,6 @@
[NsfwCommand(true)]
[SlashCommand("beautiful-code", "Get an image of perfect code")]
public async Task BeautifulCodeAsync(...)
{
...
}

Loading…
Cancel
Save