[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:
Misha133
2022-12-20 01:00:56 +03:00
committed by GitHub
parent 60956c720b
commit 56b1a930e7
23 changed files with 230 additions and 15 deletions

View File

@@ -39,6 +39,9 @@ namespace Discord.WebSocket
/// <inheritdoc/>
public bool IsEnabledInDm { get; private set; }
/// <inheritdoc/>
public bool IsNsfw { get; private set; }
/// <inheritdoc/>
public GuildPermissions DefaultMemberPermissions { get; private set; }
@@ -130,6 +133,7 @@ namespace Discord.WebSocket
IsEnabledInDm = model.DmPermission.GetValueOrDefault(true).GetValueOrDefault(true);
DefaultMemberPermissions = new GuildPermissions((ulong)model.DefaultMemberPermission.GetValueOrDefault(0).GetValueOrDefault(0));
IsNsfw = model.Nsfw.GetValueOrDefault(false).GetValueOrDefault(false);
}
/// <inheritdoc/>