[Feature] Guild incident actions (#2783)

* initial commit

* <see langword="null"/> notes
This commit is contained in:
Mihail Gribkov
2023-11-02 09:18:29 +03:00
committed by GitHub
parent 4e78aec2d0
commit 9b36df3c55
10 changed files with 134 additions and 0 deletions

View File

@@ -143,6 +143,8 @@ namespace Discord.WebSocket
public bool IsBoostProgressBarEnabled { get; private set; }
/// <inheritdoc />
public GuildFeatures Features { get; private set; }
/// <inheritdoc/>
public GuildIncidentsData IncidentsData { get; private set; }
/// <inheritdoc />
public DateTimeOffset CreatedAt => SnowflakeUtils.FromSnowflake(Id);
@@ -560,6 +562,9 @@ namespace Discord.WebSocket
PreferredCulture = PreferredLocale == null ? null : new CultureInfo(PreferredLocale);
if (model.IsBoostProgressBarEnabled.IsSpecified)
IsBoostProgressBarEnabled = model.IsBoostProgressBarEnabled.Value;
IncidentsData = model.IncidentsData is not null
? new GuildIncidentsData { DmsDisabledUntil = model.IncidentsData.DmsDisabledUntil, InvitesDisabledUntil = model.IncidentsData.InvitesDisabledUntil }
: new GuildIncidentsData();
if (model.Emojis != null)
{
var emojis = ImmutableArray.CreateBuilder<GuildEmote>(model.Emojis.Length);
@@ -656,6 +661,11 @@ namespace Discord.WebSocket
/// <inheritdoc />
public Task LeaveAsync(RequestOptions options = null)
=> GuildHelper.LeaveAsync(this, Discord, options);
/// <inheritdoc />
public Task<GuildIncidentsData> ModifyIncidentActionsAsync(Action<GuildIncidentsDataProperties> props, RequestOptions options = null)
=> GuildHelper.ModifyGuildIncidentActionsAsync(this, Discord, props, options);
#endregion
#region Bans