-
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
23 additions
and
3 deletions.
There are no files selected for viewing
26 changes: 23 additions & 3 deletions
26
DisCatSharp/Entities/Guild/AuditLog/ChangeSet/ChannelDeleteChangeSet.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |