Skip to content

Commit

Permalink
feat: ChannelDeleteChangeSet
Browse files Browse the repository at this point in the history
  • Loading branch information
TheXorog committed Oct 17, 2023
1 parent 5726118 commit dc975b4
Showing 1 changed file with 23 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,27 @@
namespace DisCatSharp.Entities;
using System.Linq;

using DisCatSharp.Enums;

namespace DisCatSharp.Entities;

/// <summary>
/// Represents a change set for a channel deletion.
/// </summary>
public class ChannelDeleteChangeSet : DiscordAuditLogEntry
{ }
public sealed class ChannelDeleteChangeSet : DiscordAuditLogEntry
{
internal ChannelDeleteChangeSet()
{
this.ValidFor = AuditLogActionType.ChannelDelete;
}

public string Name => (string)this.Changes.FirstOrDefault(x => x.Key == "name")?.OldValue;
public string? Topic => (string?)this.Changes.FirstOrDefault(x => x.Key == "topic")?.OldValue;
public ChannelType Type => (ChannelType)this.Changes.FirstOrDefault(x => x.Key == "type")?.OldValue;
public DiscordOverwrite[] PermissionOverwrites => (DiscordOverwrite[])this.Changes.FirstOrDefault(x => x.Key == "permission_overwrites")?.OldValue;
public bool IsNfsw => (bool)this.Changes.FirstOrDefault(x => x.Key == "nsfw")?.OldValue;
public int PerUserRateLimit => (int)this.Changes.FirstOrDefault(x => x.Key == "rate_limit_per_user")?.OldValue;
public ThreadAutoArchiveDuration? DefaultAutoArchiveDuration => (ThreadAutoArchiveDuration?)this.Changes.FirstOrDefault(x => x.Key == "default_auto_archive_duration")?.NewValue;
public DiscordEmoji? IconEmoji => (DiscordEmoji?)this.Changes.FirstOrDefault(x => x.Key == "icon_emoji")?.OldValue;
public ForumPostTag? AvailableTags => (ForumPostTag?)this.Changes.FirstOrDefault(x => x.Key == "available_tags")?.OldValue;
public ChannelFlags Flags => (ChannelFlags)this.Changes.FirstOrDefault(x => x.Key == "flags")?.OldValue;
}

0 comments on commit dc975b4

Please sign in to comment.