Skip to content

Commit

Permalink
aaaaaa
Browse files Browse the repository at this point in the history
  • Loading branch information
Lulalaby committed Oct 17, 2023
1 parent 8c56f95 commit b2fecac
Show file tree
Hide file tree
Showing 65 changed files with 150 additions and 126 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ namespace DisCatSharp.Entities;
/// <summary>
/// Represents a change set for updating permissions for an application command.
/// </summary>
public class ApplicationCommandPermissionUpdateChangeSet : AuditLogChangeSet
public class ApplicationCommandPermissionUpdateChangeSet : DiscordAuditLogEntry
{ }
29 changes: 0 additions & 29 deletions DisCatSharp/Entities/Guild/AuditLog/ChangeSet/AuditLogChangeSet.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
/// <summary>
/// Represents a change set for a message being blocked by Auto Moderation.
/// </summary>
public class AutoModerationBlockMessageChangeSet : AuditLogChangeSet
public class AutoModerationBlockMessageChangeSet : DiscordAuditLogEntry
{ }
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
/// <summary>
/// Represents a change set for a message being flagged by Auto Moderation.
/// </summary>
public class AutoModerationFlagToChannelChangeSet : AuditLogChangeSet
public class AutoModerationFlagToChannelChangeSet : DiscordAuditLogEntry
{ }
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
/// <summary>
/// Represents a change set for creating an Auto Moderation rule.
/// </summary>
public class AutoModerationRuleCreateChangeSet : AuditLogChangeSet
public class AutoModerationRuleCreateChangeSet : DiscordAuditLogEntry
{ }
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ namespace DisCatSharp.Entities;
/// <summary>
/// Represents a change set for deleting an Auto Moderation rule.
/// </summary>
public class AutoModerationRuleDeleteChangeSet : AuditLogChangeSet
public class AutoModerationRuleDeleteChangeSet : DiscordAuditLogEntry
{ }
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
/// <summary>
/// Represents a change set for updating an Auto Moderation rule.
/// </summary>
public class AutoModerationRuleUpdateChangeSet : AuditLogChangeSet
public class AutoModerationRuleUpdateChangeSet : DiscordAuditLogEntry
{ }
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
/// <summary>
/// Represents a change set for a member being timed out by Auto Moderation.
/// </summary>
public class AutoModerationUserCommunicationDisabledChangeSet : AuditLogChangeSet
public class AutoModerationUserCommunicationDisabledChangeSet : DiscordAuditLogEntry
{ }
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
/// <summary>
/// Represents a change set for adding a bot user to the server.
/// </summary>
public class BotAddChangeSet : AuditLogChangeSet
public class BotAddChangeSet : DiscordAuditLogEntry
{ }
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ namespace DisCatSharp.Entities;
/// <summary>
/// Represents a change set for a new channel creation.
/// </summary>
public class ChannelCreateChangeSet : AuditLogChangeSet
public class ChannelCreateChangeSet : DiscordAuditLogEntry
{ }
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
/// <summary>
/// Represents a change set for a channel deletion.
/// </summary>
public class ChannelDeleteChangeSet : AuditLogChangeSet
public class ChannelDeleteChangeSet : DiscordAuditLogEntry
{ }
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System;
using System.Linq;

using DisCatSharp.Enums;
Expand All @@ -8,10 +7,12 @@ namespace DisCatSharp.Entities;
/// <summary>
/// Represents a change set for adding a permission overwrite to a channel.
/// </summary>
public class ChannelOverwriteCreateChangeSet : AuditLogChangeSet
public class ChannelOverwriteCreateChangeSet : DiscordAuditLogEntry
{
/// <inheritdoc cref="AuditLogChangeSet.ValidFor" />
public new AuditLogActionType ValidFor = AuditLogActionType.ChannelOverwriteCreate;
public ChannelOverwriteCreateChangeSet()
{
this.ValidFor = AuditLogActionType.ChannelOverwriteCreate;
}

public bool AllowChanged => this.AllowBefore is not null || this.AllowAfter is not null;
public Permissions? AllowBefore => (Permissions?)this.Changes.FirstOrDefault(x => x.Key == "allow")?.OldValue;
Expand All @@ -21,7 +22,7 @@ public class ChannelOverwriteCreateChangeSet : AuditLogChangeSet
public Permissions? DenyBefore => (Permissions?)this.Changes.FirstOrDefault(x => x.Key == "deny")?.OldValue;
public Permissions? DenyAfter => (Permissions?)this.Changes.FirstOrDefault(x => x.Key == "deny")?.NewValue;

public override string ChangeDescription
internal override string ChangeDescription
{
get
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ namespace DisCatSharp.Entities;
/// <summary>
/// Represents a change set for deleting a permission overwrite from a channel.
/// </summary>
public class ChannelOverwriteDeleteChangeSet : AuditLogChangeSet
public class ChannelOverwriteDeleteChangeSet : DiscordAuditLogEntry
{
/// <inheritdoc cref="AuditLogChangeSet.ValidFor" />
public new AuditLogActionType ValidFor = AuditLogActionType.ChannelOverwriteDelete;
public ChannelOverwriteDeleteChangeSet()
{
this.ValidFor = AuditLogActionType.ChannelOverwriteDelete;
}

public bool AllowChanged => this.AllowBefore is not null || this.AllowAfter is not null;
public Permissions? AllowBefore => (Permissions?)this.Changes.FirstOrDefault(x => x.Key == "allow")?.OldValue;
Expand All @@ -20,7 +22,7 @@ public class ChannelOverwriteDeleteChangeSet : AuditLogChangeSet
public Permissions? DenyBefore => (Permissions?)this.Changes.FirstOrDefault(x => x.Key == "deny")?.OldValue;
public Permissions? DenyAfter => (Permissions?)this.Changes.FirstOrDefault(x => x.Key == "deny")?.NewValue;

public override string ChangeDescription
internal override string ChangeDescription
{
get
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ namespace DisCatSharp.Entities;
/// <summary>
/// Represents a change set for updating a permission overwrite for a channel.
/// </summary>
public class ChannelOverwriteUpdateChangeSet : AuditLogChangeSet
public class ChannelOverwriteUpdateChangeSet : DiscordAuditLogEntry
{
/// <inheritdoc cref="AuditLogChangeSet.ValidFor" />
public new AuditLogActionType ValidFor = AuditLogActionType.ChannelOverwriteUpdate;
public ChannelOverwriteUpdateChangeSet()
{
this.ValidFor = AuditLogActionType.ChannelOverwriteUpdate;
}

public bool AllowChanged => this.AllowBefore is not null || this.AllowAfter is not null;
public Permissions? AllowBefore => (Permissions?)this.Changes.FirstOrDefault(x => x.Key == "allow")?.OldValue;
Expand All @@ -20,7 +22,7 @@ public class ChannelOverwriteUpdateChangeSet : AuditLogChangeSet
public Permissions? DenyBefore => (Permissions?)this.Changes.FirstOrDefault(x => x.Key == "deny")?.OldValue;
public Permissions? DenyAfter => (Permissions?)this.Changes.FirstOrDefault(x => x.Key == "deny")?.NewValue;

public override string ChangeDescription
internal override string ChangeDescription
{
get
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
/// <summary>
/// Represents a change set for updating channel settings.
/// </summary>
public class ChannelUpdateChangeSet : AuditLogChangeSet
public class ChannelUpdateChangeSet : DiscordAuditLogEntry
{ }
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
/// <summary>
/// Represents a change set for the creation of a creator monetization request.
/// </summary>
public class CreatorMonetizationRequestCreatedChangeSet : AuditLogChangeSet
public class CreatorMonetizationRequestCreatedChangeSet : DiscordAuditLogEntry
{ }
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
/// <summary>
/// Represents a change set for the acceptance of creator monetization terms.
/// </summary>
public class CreatorMonetizationTermsAcceptedChangeSet : AuditLogChangeSet
public class CreatorMonetizationTermsAcceptedChangeSet : DiscordAuditLogEntry
{ }
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
/// <summary>
/// Represents a change set for creating an emoji.
/// </summary>
public class EmojiCreateChangeSet : AuditLogChangeSet
public class EmojiCreateChangeSet : DiscordAuditLogEntry
{ }
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
/// <summary>
/// Represents a change set for deleting an emoji.
/// </summary>
public class EmojiDeleteChangeSet : AuditLogChangeSet
public class EmojiDeleteChangeSet : DiscordAuditLogEntry
{ }
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
/// <summary>
/// Represents a change set for updating the name of an emoji.
/// </summary>
public class EmojiUpdateChangeSet : AuditLogChangeSet
public class EmojiUpdateChangeSet : DiscordAuditLogEntry
{ }
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
/// <summary>
/// Represents a change set for creating a guild scheduled event.
/// </summary>
public class GuildScheduledEventCreateChangeSet : AuditLogChangeSet
public class GuildScheduledEventCreateChangeSet : DiscordAuditLogEntry
{ }
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
/// <summary>
/// Represents a change set for cancelling a guild scheduled event.
/// </summary>
public class GuildScheduledEventDeleteChangeSet : AuditLogChangeSet
public class GuildScheduledEventDeleteChangeSet : DiscordAuditLogEntry
{ }
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
/// <summary>
/// Represents a change set for updating a guild scheduled event.
/// </summary>
public class GuildScheduledEventUpdateChangeSet : AuditLogChangeSet
public class GuildScheduledEventUpdateChangeSet : DiscordAuditLogEntry
{ }
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System;
using System.Collections.Generic;
using System.Linq;

Expand All @@ -9,10 +8,12 @@ namespace DisCatSharp.Entities;
/// <summary>
/// Represents a change set for a server settings update.
/// </summary>
public class GuildUpdateChangeSet : AuditLogChangeSet
public class GuildUpdateChangeSet : DiscordAuditLogEntry
{
/// <inheritdoc cref="AuditLogChangeSet.ValidFor" />
public new AuditLogActionType ValidFor = AuditLogActionType.GuildUpdate;
public GuildUpdateChangeSet()
{
this.ValidFor = AuditLogActionType.GuildUpdate;
}

public bool NameChanged => this.NameBefore is not null || this.NameAfter is not null;
public string? NameBefore => (string?)this.Changes.FirstOrDefault(x => x.Key == "name")?.OldValue;
Expand All @@ -31,12 +32,12 @@ public class GuildUpdateChangeSet : AuditLogChangeSet
public string? DiscoverySplashAfter => (string?)this.Changes.FirstOrDefault(x => x.Key == "discovery_splash")?.NewValue;

public bool OwnerIdChanged => this.OwnerIdBefore is not null || this.OwnerIdAfter is not null;
public ulong? OwnerIdBefore => (ulong?)this.Changes.FirstOrDefault(x => x.Key == "owner_id")?.OldValue;
public ulong? OwnerIdAfter => (ulong?)this.Changes.FirstOrDefault(x => x.Key == "owner_id")?.NewValue;
public ulong? OwnerIdBefore => ConvertToUlong(this.Changes.FirstOrDefault(x => x.Key == "owner_id")?.OldValue);
public ulong? OwnerIdAfter => ConvertToUlong(this.Changes.FirstOrDefault(x => x.Key == "owner_id")?.NewValue);

public bool AfkChannelIdChanged => this.AfkChannelIdBefore is not null || this.AfkChannelIdAfter is not null;
public ulong? AfkChannelIdBefore => (ulong?)this.Changes.FirstOrDefault(x => x.Key == "afk_channel_id")?.OldValue;
public ulong? AfkChannelIdAfter => (ulong?)this.Changes.FirstOrDefault(x => x.Key == "afk_channel_id")?.NewValue;
public ulong? AfkChannelIdBefore =>ConvertToUlong(this.Changes.FirstOrDefault(x => x.Key == "afk_channel_id")?.OldValue);
public ulong? AfkChannelIdAfter => ConvertToUlong(this.Changes.FirstOrDefault(x => x.Key == "afk_channel_id")?.NewValue);

public bool AfkTimeoutChanged => this.AfkTimeoutBefore is not null || this.AfkTimeoutAfter is not null;
public int? AfkTimeoutBefore => (int?)this.Changes.FirstOrDefault(x => x.Key == "afk_timeout")?.OldValue;
Expand All @@ -47,8 +48,8 @@ public class GuildUpdateChangeSet : AuditLogChangeSet
public bool? WidgetEnabledAfter => (bool?)this.Changes.FirstOrDefault(x => x.Key == "widget_enabled")?.NewValue;

public bool WidgetChannelIdChanged => this.WidgetChannelIdBefore is not null || this.WidgetChannelIdAfter is not null;
public ulong? WidgetChannelIdBefore => (ulong?)this.Changes.FirstOrDefault(x => x.Key == "widget_channel_id")?.OldValue;
public ulong? WidgetChannelIdAfter => (ulong?)this.Changes.FirstOrDefault(x => x.Key == "widget_channel_id")?.NewValue;
public ulong? WidgetChannelIdBefore => ConvertToUlong(this.Changes.FirstOrDefault(x => x.Key == "widget_channel_id")?.OldValue);
public ulong? WidgetChannelIdAfter => ConvertToUlong(this.Changes.FirstOrDefault(x => x.Key == "widget_channel_id")?.NewValue);

public bool VerificationLevelChanged => this.VerificationLevelBefore is not null || this.VerificationLevelAfter is not null;
public VerificationLevel? VerificationLevelBefore => (VerificationLevel?)this.Changes.FirstOrDefault(x => x.Key == "verification_level")?.OldValue;
Expand All @@ -71,16 +72,16 @@ public class GuildUpdateChangeSet : AuditLogChangeSet
public MfaLevel? MfaLevelAfter => (MfaLevel?)this.Changes.FirstOrDefault(x => x.Key == "mfa_level")?.NewValue;

public bool SystemChannelIdChanged => this.SystemChannelIdBefore is not null || this.SystemChannelIdAfter is not null;
public ulong? SystemChannelIdBefore => (ulong?)this.Changes.FirstOrDefault(x => x.Key == "system_channel_id")?.OldValue;
public ulong? SystemChannelIdAfter => (ulong?)this.Changes.FirstOrDefault(x => x.Key == "system_channel_id")?.NewValue;
public ulong? SystemChannelIdBefore => ConvertToUlong(this.Changes.FirstOrDefault(x => x.Key == "system_channel_id")?.OldValue);
public ulong? SystemChannelIdAfter => ConvertToUlong(this.Changes.FirstOrDefault(x => x.Key == "system_channel_id")?.NewValue);

public bool SystemChannelFlagsChanged => this.SystemChannelFlagsBefore is not null || this.SystemChannelFlagsAfter is not null;
public SystemChannelFlags? SystemChannelFlagsBefore => (SystemChannelFlags?)this.Changes.FirstOrDefault(x => x.Key == "system_channel_flags")?.OldValue;
public SystemChannelFlags? SystemChannelFlagsAfter => (SystemChannelFlags?)this.Changes.FirstOrDefault(x => x.Key == "system_channel_flags")?.NewValue;

public bool RulesChannelIdChanged => this.RulesChannelIdBefore is not null || this.RulesChannelIdAfter is not null;
public ulong? RulesChannelIdBefore => (ulong?)this.Changes.FirstOrDefault(x => x.Key == "rules_channel_id")?.OldValue;
public ulong? RulesChannelIdAfter => (ulong?)this.Changes.FirstOrDefault(x => x.Key == "rules_channel_id")?.NewValue;
public ulong? RulesChannelIdBefore => ConvertToUlong(this.Changes.FirstOrDefault(x => x.Key == "rules_channel_id")?.OldValue);
public ulong? RulesChannelIdAfter => ConvertToUlong(this.Changes.FirstOrDefault(x => x.Key == "rules_channel_id")?.NewValue);

public bool VanityUrlCodeChanged => this.VanityUrlCodeBefore is not null || this.VanityUrlCodeAfter is not null;
public string? VanityUrlCodeBefore => (string?)this.Changes.FirstOrDefault(x => x.Key == "vanity_url_code")?.OldValue;
Expand All @@ -99,8 +100,8 @@ public class GuildUpdateChangeSet : AuditLogChangeSet
public string? PreferredLocaleAfter => (string?)this.Changes.FirstOrDefault(x => x.Key == "preferred_locale")?.NewValue;

public bool PublicUpdatesChannelIdChanged => this.PublicUpdatesChannelIdBefore is not null || this.PublicUpdatesChannelIdAfter is not null;
public ulong? PublicUpdatesChannelIdBefore => (ulong?)this.Changes.FirstOrDefault(x => x.Key == "public_updates_channel_id")?.OldValue;
public ulong? PublicUpdatesChannelIdAfter => (ulong?)this.Changes.FirstOrDefault(x => x.Key == "public_updates_channel_id")?.NewValue;
public ulong? PublicUpdatesChannelIdBefore => ConvertToUlong(this.Changes.FirstOrDefault(x => x.Key == "public_updates_channel_id")?.OldValue);
public ulong? PublicUpdatesChannelIdAfter => ConvertToUlong(this.Changes.FirstOrDefault(x => x.Key == "public_updates_channel_id")?.NewValue);

public bool NsfwLevelChanged => this.NsfwLevelBefore is not null || this.NsfwLevelAfter is not null;
public NsfwLevel? NsfwLevelBefore => (NsfwLevel?)this.Changes.FirstOrDefault(x => x.Key == "nsfw_level")?.OldValue;
Expand All @@ -111,10 +112,10 @@ public class GuildUpdateChangeSet : AuditLogChangeSet
public bool? PremiumProgressBarEnabledAfter => (bool?)this.Changes.FirstOrDefault(x => x.Key == "premium_progress_bar_enabled")?.NewValue;

public bool SafetyAlertsChannelIdChanged => this.SafetyAlertsChannelIdBefore is not null || this.SafetyAlertsChannelIdAfter is not null;
public ulong? SafetyAlertsChannelIdBefore => (ulong?)this.Changes.FirstOrDefault(x => x.Key == "safety_alerts_channel_id")?.OldValue;
public ulong? SafetyAlertsChannelIdAfter => (ulong?)this.Changes.FirstOrDefault(x => x.Key == "safety_alerts_channel_id")?.NewValue;
public ulong? SafetyAlertsChannelIdBefore => ConvertToUlong(this.Changes.FirstOrDefault(x => x.Key == "safety_alerts_channel_id")?.OldValue);
public ulong? SafetyAlertsChannelIdAfter => ConvertToUlong(this.Changes.FirstOrDefault(x => x.Key == "safety_alerts_channel_id")?.NewValue);

public override string ChangeDescription
internal override string ChangeDescription
{
get
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
/// <summary>
/// Represents a change set for adding an app to the server.
/// </summary>
public class IntegrationCreateChangeSet : AuditLogChangeSet
public class IntegrationCreateChangeSet : DiscordAuditLogEntry
{ }
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
/// <summary>
/// Represents a change set for removing an app from the server.
/// </summary>
public class IntegrationDeleteChangeSet : AuditLogChangeSet
public class IntegrationDeleteChangeSet : DiscordAuditLogEntry
{ }
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
/// <summary>
/// Represents a change set for updating an app, such as its scopes.
/// </summary>
public class IntegrationUpdateChangeSet : AuditLogChangeSet
public class IntegrationUpdateChangeSet : DiscordAuditLogEntry
{ }
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
/// <summary>
/// Represents a change set for creating a server invite.
/// </summary>
public class InviteCreateChangeSet : AuditLogChangeSet
public class InviteCreateChangeSet : DiscordAuditLogEntry
{ }
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
/// <summary>
/// Represents a change set for deleting a server invite.
/// </summary>
public class InviteDeleteChangeSet : AuditLogChangeSet
public class InviteDeleteChangeSet : DiscordAuditLogEntry
{ }
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
/// <summary>
/// Represents a change set for updating a server invite.
/// </summary>
public class InviteUpdateChangeSet : AuditLogChangeSet
public class InviteUpdateChangeSet : DiscordAuditLogEntry
{ }
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
/// <summary>
/// Represents a change set for banning a member from the server.
/// </summary>
public class MemberBanAddChangeSet : AuditLogChangeSet
public class MemberBanAddChangeSet : DiscordAuditLogEntry
{ }
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
/// <summary>
/// Represents a change set for lifting a server ban for a member.
/// </summary>
public class MemberBanRemoveChangeSet : AuditLogChangeSet
public class MemberBanRemoveChangeSet : DiscordAuditLogEntry
{ }
Loading

0 comments on commit b2fecac

Please sign in to comment.