From 6825d961bb71093822ea9f397e55d112b1e8f422 Mon Sep 17 00:00:00 2001 From: Lala Sabathil Date: Sun, 24 Sep 2023 12:53:57 +0200 Subject: [PATCH] fix!: remove privacy level from stage and scheduled event --- DisCatSharp/Clients/DiscordClient.cs | 1 - .../Entities/Guild/DiscordAuditLogObjects.cs | 10 ---------- .../Entities/Guild/DiscordGuild.AuditLog.cs | 18 ----------------- .../ScheduledEvent/DiscordScheduledEvent.cs | 6 ------ .../Guild/Stage/DiscordStageInstance.cs | 6 ------ .../ScheduledEventPrivacyLevel.cs | 18 ----------------- DisCatSharp/Enums/Guild/Stage/.gitkeep | 0 .../Enums/Guild/Stage/StagePrivacyLevel.cs | 20 ------------------- .../Net/Abstractions/AuditLogAbstractions.cs | 6 ------ .../Rest/RestGuildScheduledEventPayloads.cs | 6 ------ 10 files changed, 91 deletions(-) delete mode 100644 DisCatSharp/Enums/Guild/ScheduledEvent/ScheduledEventPrivacyLevel.cs create mode 100644 DisCatSharp/Enums/Guild/Stage/.gitkeep delete mode 100644 DisCatSharp/Enums/Guild/Stage/StagePrivacyLevel.cs diff --git a/DisCatSharp/Clients/DiscordClient.cs b/DisCatSharp/Clients/DiscordClient.cs index 0bf3f5e7a..63716bdb6 100644 --- a/DisCatSharp/Clients/DiscordClient.cs +++ b/DisCatSharp/Clients/DiscordClient.cs @@ -1335,7 +1335,6 @@ private DiscordScheduledEvent UpdateScheduledEvent(DiscordScheduledEvent schedul old.EntityId = scheduledEvent.EntityId; old.EntityType = scheduledEvent.EntityType; old.EntityMetadata = scheduledEvent.EntityMetadata; - old.PrivacyLevel = scheduledEvent.PrivacyLevel; old.Name = scheduledEvent.Name; old.Status = scheduledEvent.Status; old.UserCount = scheduledEvent.UserCount; diff --git a/DisCatSharp/Entities/Guild/DiscordAuditLogObjects.cs b/DisCatSharp/Entities/Guild/DiscordAuditLogObjects.cs index 4e1e08c2c..89cda0ffb 100644 --- a/DisCatSharp/Entities/Guild/DiscordAuditLogObjects.cs +++ b/DisCatSharp/Entities/Guild/DiscordAuditLogObjects.cs @@ -721,11 +721,6 @@ public sealed class DiscordAuditLogStageEntry : DiscordAuditLogEntry /// public PropertyChange TopicChange { get; internal set; } - /// - /// Gets the description of stage instance's privacy level change. - /// - public PropertyChange PrivacyLevelChange { get; internal set; } - /// /// Initializes a new instance of the class. /// @@ -768,11 +763,6 @@ public sealed class DiscordAuditLogGuildScheduledEventEntry : DiscordAuditLogEnt /// public PropertyChange LocationChange { get; internal set; } - /// - /// Gets the privacy level change. - /// - public PropertyChange PrivacyLevelChange { get; internal set; } - /// /// Gets the status change. /// diff --git a/DisCatSharp/Entities/Guild/DiscordGuild.AuditLog.cs b/DisCatSharp/Entities/Guild/DiscordGuild.AuditLog.cs index ec42754c1..e3c780d3f 100644 --- a/DisCatSharp/Entities/Guild/DiscordGuild.AuditLog.cs +++ b/DisCatSharp/Entities/Guild/DiscordGuild.AuditLog.cs @@ -895,13 +895,6 @@ PropertyChange GetChannelChange() After = xc.NewValueString }; break; - case "privacy_level": - entrysta.PrivacyLevelChange = new() - { - Before = long.TryParse(xc.OldValue as string, NumberStyles.Integer, CultureInfo.InvariantCulture, out t5) ? (StagePrivacyLevel?)t5 : null, - After = long.TryParse(xc.NewValue as string, NumberStyles.Integer, CultureInfo.InvariantCulture, out t6) ? (StagePrivacyLevel?)t6 : null, - }; - break; default: if (this.Discord.Configuration.ReportMissingFields) @@ -1268,17 +1261,6 @@ PropertyChange GetChannelChange() }; break; - case "privacy_level": - p1 = long.TryParse(xc.OldValue as string, NumberStyles.Integer, CultureInfo.InvariantCulture, out t5); - p2 = long.TryParse(xc.NewValue as string, NumberStyles.Integer, CultureInfo.InvariantCulture, out t6); - - entryse.PrivacyLevelChange = new() - { - Before = p1 ? (ScheduledEventPrivacyLevel?)t5 : null, - After = p2 ? (ScheduledEventPrivacyLevel?)t6 : null - }; - break; - case "entity_type": p1 = long.TryParse(xc.OldValue as string, NumberStyles.Integer, CultureInfo.InvariantCulture, out t5); p2 = long.TryParse(xc.NewValue as string, NumberStyles.Integer, CultureInfo.InvariantCulture, out t6); diff --git a/DisCatSharp/Entities/Guild/ScheduledEvent/DiscordScheduledEvent.cs b/DisCatSharp/Entities/Guild/ScheduledEvent/DiscordScheduledEvent.cs index d5d3d216f..8f0cab38d 100644 --- a/DisCatSharp/Entities/Guild/ScheduledEvent/DiscordScheduledEvent.cs +++ b/DisCatSharp/Entities/Guild/ScheduledEvent/DiscordScheduledEvent.cs @@ -116,12 +116,6 @@ public DateTimeOffset? ScheduledEndTime [JsonProperty("scheduled_end_time", NullValueHandling = NullValueHandling.Ignore)] internal string ScheduledEndTimeRaw { get; set; } - /// - /// Gets the privacy level of the scheduled event. - /// - [JsonProperty("privacy_level", NullValueHandling = NullValueHandling.Ignore)] - internal ScheduledEventPrivacyLevel PrivacyLevel { get; set; } - /// /// Gets the status of the scheduled event. /// diff --git a/DisCatSharp/Entities/Guild/Stage/DiscordStageInstance.cs b/DisCatSharp/Entities/Guild/Stage/DiscordStageInstance.cs index 97d7b9031..4fa2dd93b 100644 --- a/DisCatSharp/Entities/Guild/Stage/DiscordStageInstance.cs +++ b/DisCatSharp/Entities/Guild/Stage/DiscordStageInstance.cs @@ -37,12 +37,6 @@ public DiscordGuild Guild [JsonProperty("topic", NullValueHandling = NullValueHandling.Ignore)] public string Topic { get; internal set; } - /// - /// Gets the topic of the Stage instance. - /// - [JsonProperty("privacy_level", NullValueHandling = NullValueHandling.Ignore), DiscordDeprecated("Will be static due to the discovery removal.")] - public StagePrivacyLevel PrivacyLevel { get; internal set; } = StagePrivacyLevel.GuildOnly; - /// /// Gets whether or not stage discovery is disabled. /// diff --git a/DisCatSharp/Enums/Guild/ScheduledEvent/ScheduledEventPrivacyLevel.cs b/DisCatSharp/Enums/Guild/ScheduledEvent/ScheduledEventPrivacyLevel.cs deleted file mode 100644 index 212eb5043..000000000 --- a/DisCatSharp/Enums/Guild/ScheduledEvent/ScheduledEventPrivacyLevel.cs +++ /dev/null @@ -1,18 +0,0 @@ - -namespace DisCatSharp.Enums; - -/// -/// Represents the privacy level for a guild scheduled event. -/// -public enum ScheduledEventPrivacyLevel : int -{ - /// - /// Indicates that the guild scheduled event is public. - /// - Public = 1, - - /// - /// Indicates that the the guild scheduled event is only accessible to guild members. - /// - GuildOnly = 2 -} diff --git a/DisCatSharp/Enums/Guild/Stage/.gitkeep b/DisCatSharp/Enums/Guild/Stage/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/DisCatSharp/Enums/Guild/Stage/StagePrivacyLevel.cs b/DisCatSharp/Enums/Guild/Stage/StagePrivacyLevel.cs deleted file mode 100644 index 7d255a764..000000000 --- a/DisCatSharp/Enums/Guild/Stage/StagePrivacyLevel.cs +++ /dev/null @@ -1,20 +0,0 @@ -using DisCatSharp.Attributes; - -namespace DisCatSharp.Enums; - -/// -/// Represents the privacy level for a stage. -/// -[DiscordDeprecated("Discord removed the feature for stage discovery. Option is defaulting to GuildOnly.")] -public enum StagePrivacyLevel : int -{ - /// - /// Indicates that the stage is public visible. - /// - Public = 1, - - /// - /// Indicates that the stage is only visible to guild members. - /// - GuildOnly = 2 -} diff --git a/DisCatSharp/Net/Abstractions/AuditLogAbstractions.cs b/DisCatSharp/Net/Abstractions/AuditLogAbstractions.cs index 06e9f6c50..41070d3c4 100644 --- a/DisCatSharp/Net/Abstractions/AuditLogAbstractions.cs +++ b/DisCatSharp/Net/Abstractions/AuditLogAbstractions.cs @@ -241,12 +241,6 @@ internal sealed class AuditLogGuildScheduledEvent [JsonProperty("scheduled_end_time")] public string ScheduledEndTime { get; set; } - /// - /// Gets the scheduled event privacy level. - /// - [JsonProperty("privacy_level")] - public ScheduledEventPrivacyLevel PrivacyLevel { get; set; } - /// /// Gets the scheduled event status. /// diff --git a/DisCatSharp/Net/Abstractions/Rest/RestGuildScheduledEventPayloads.cs b/DisCatSharp/Net/Abstractions/Rest/RestGuildScheduledEventPayloads.cs index ab6561ed5..7097ceaf9 100644 --- a/DisCatSharp/Net/Abstractions/Rest/RestGuildScheduledEventPayloads.cs +++ b/DisCatSharp/Net/Abstractions/Rest/RestGuildScheduledEventPayloads.cs @@ -36,12 +36,6 @@ internal sealed class RestGuildScheduledEventCreatePayload : ObservableApiObject [JsonProperty("description", NullValueHandling = NullValueHandling.Ignore)] public string Description { get; set; } - /// - /// Gets or sets the privacy level of the scheduled event. - /// - [JsonProperty("privacy_level")] - public ScheduledEventPrivacyLevel PrivacyLevel { get; set; } - /// /// Gets or sets the time to schedule the scheduled event. ///