[Feature] Age restricted (NSFW) application commands support (#2531)
* add `nsfw` to data model & internal methods; add missing property * add `nsfw` prop to command builders * add `NsfwCommandAttribute` to Interaction Framework * working state * docs?
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
[NsfwCommand(true)]
|
||||
[SlashCommand("beautiful-code", "Get an image of perfect code")]
|
||||
public async Task BeautifulCodeAsync(...)
|
||||
{
|
||||
...
|
||||
}
|
||||
Reference in New Issue
Block a user