From d099358ee6340f551a8c5ee3c610a3eb8189f3d3 Mon Sep 17 00:00:00 2001 From: Misha133 Date: Wed, 14 Dec 2022 14:21:43 +0300 Subject: [PATCH] docs? --- docs/guides/int_framework/permissions.md | 5 +++++ .../int_framework/samples/permissions/nsfw-permissions.cs | 6 ++++++ 2 files changed, 11 insertions(+) create mode 100644 docs/guides/int_framework/samples/permissions/nsfw-permissions.cs diff --git a/docs/guides/int_framework/permissions.md b/docs/guides/int_framework/permissions.md index e35bb162d..f02c50ebb 100644 --- a/docs/guides/int_framework/permissions.md +++ b/docs/guides/int_framework/permissions.md @@ -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 diff --git a/docs/guides/int_framework/samples/permissions/nsfw-permissions.cs b/docs/guides/int_framework/samples/permissions/nsfw-permissions.cs new file mode 100644 index 000000000..21f93b54d --- /dev/null +++ b/docs/guides/int_framework/samples/permissions/nsfw-permissions.cs @@ -0,0 +1,6 @@ +[NsfwCommand(true)] +[SlashCommand("beautiful-code", "Get an image of perfect code")] +public async Task BeautifulCodeAsync(...) +{ + ... +} \ No newline at end of file