From f0256ef20286656ff258d3a177eff80a9b21d792 Mon Sep 17 00:00:00 2001 From: Eldar Bakirov Date: Tue, 12 Mar 2024 17:17:59 +0600 Subject: [PATCH 01/19] Implemented gateway events GUILD_JOIN_REQUEST_UPDATE and GUILD_JOIN_REQUEST_DELETE. --- .../GuildJoinRequestDeleteEventArgs.cs | 12 ++++++ .../GuildJoinRequestUpdateEventArgs.cs | 14 +++++++ NetCord/Gateway/GatewayClient.cs | 12 ++++++ NetCord/Gateway/GuildJoinRequest.cs | 25 +++++++++++++ NetCord/Gateway/GuildJoinRequestStatus.cs | 15 ++++++++ .../JsonGuildJoinRequestDeleteEventArgs.cs | 13 +++++++ .../JsonGuildJoinRequestUpdateEventArgs.cs | 13 +++++++ .../JsonModels/JsonGuildJoinRequest.cs | 37 +++++++++++++++++++ .../JsonModels/JsonVerificationField.cs | 20 ++++++++++ NetCord/Gateway/VerificationField.cs | 12 ++++++ NetCord/Gateway/VerificationFieldType.cs | 19 ++++++++++ NetCord/Serialization.cs | 6 +++ 12 files changed, 198 insertions(+) create mode 100644 NetCord/Gateway/EventArgs/GuildJoinRequestDeleteEventArgs.cs create mode 100644 NetCord/Gateway/EventArgs/GuildJoinRequestUpdateEventArgs.cs create mode 100644 NetCord/Gateway/GuildJoinRequest.cs create mode 100644 NetCord/Gateway/GuildJoinRequestStatus.cs create mode 100644 NetCord/Gateway/JsonModels/EventArgs/JsonGuildJoinRequestDeleteEventArgs.cs create mode 100644 NetCord/Gateway/JsonModels/EventArgs/JsonGuildJoinRequestUpdateEventArgs.cs create mode 100644 NetCord/Gateway/JsonModels/JsonGuildJoinRequest.cs create mode 100644 NetCord/Gateway/JsonModels/JsonVerificationField.cs create mode 100644 NetCord/Gateway/VerificationField.cs create mode 100644 NetCord/Gateway/VerificationFieldType.cs diff --git a/NetCord/Gateway/EventArgs/GuildJoinRequestDeleteEventArgs.cs b/NetCord/Gateway/EventArgs/GuildJoinRequestDeleteEventArgs.cs new file mode 100644 index 000000000..2d30b863e --- /dev/null +++ b/NetCord/Gateway/EventArgs/GuildJoinRequestDeleteEventArgs.cs @@ -0,0 +1,12 @@ +namespace NetCord.Gateway; + +public class GuildJoinRequestDeleteEventArgs(JsonModels.EventArgs.JsonGuildJoinRequestDeleteEventArgs jsonModel) : IJsonModel +{ + JsonModels.EventArgs.JsonGuildJoinRequestDeleteEventArgs IJsonModel.JsonModel => jsonModel; + + public ulong JoinRequestId => jsonModel.Id; + + public ulong UserId => jsonModel.UserId; + + public ulong GuildId => jsonModel.GuildId; +} diff --git a/NetCord/Gateway/EventArgs/GuildJoinRequestUpdateEventArgs.cs b/NetCord/Gateway/EventArgs/GuildJoinRequestUpdateEventArgs.cs new file mode 100644 index 000000000..67cceaf50 --- /dev/null +++ b/NetCord/Gateway/EventArgs/GuildJoinRequestUpdateEventArgs.cs @@ -0,0 +1,14 @@ +using NetCord.Rest; + +namespace NetCord.Gateway; + +public class GuildJoinRequestUpdateEventArgs(JsonModels.EventArgs.JsonGuildJoinRequestUpdateEventArgs jsonModel, RestClient client) : IJsonModel +{ + JsonModels.EventArgs.JsonGuildJoinRequestUpdateEventArgs IJsonModel.JsonModel => jsonModel; + + public GuildJoinRequestStatus Status => jsonModel.Status; + + public GuildJoinRequest Request { get; } = new(jsonModel.Request, client); + + public ulong GuildId => jsonModel.GuildId; +} diff --git a/NetCord/Gateway/GatewayClient.cs b/NetCord/Gateway/GatewayClient.cs index 4909143c5..a3610cc28 100644 --- a/NetCord/Gateway/GatewayClient.cs +++ b/NetCord/Gateway/GatewayClient.cs @@ -81,6 +81,8 @@ public partial class GatewayClient : WebSocketClient, IEntity public event Func? EntitlementUpdate; public event Func? EntitlementDelete; public event Func? UnknownEvent; + public event Func? GuildJoinRequestUpdate; + public event Func? GuildJoinRequestDelete; /// /// The token of the . @@ -717,6 +719,16 @@ await InvokeEventAsync( await InvokeEventAsync(EntitlementDelete, () => new(data.ToObject(Serialization.Default.JsonEntitlement))).ConfigureAwait(false); } break; + case "GUILD_JOIN_REQUEST_UPDATE": + { + await InvokeEventAsync(GuildJoinRequestUpdate, () => new(data.ToObject(Serialization.Default.JsonGuildJoinRequestUpdateEventArgs), Rest)).ConfigureAwait(false); + } + break; + case "GUILD_JOIN_REQUEST_DELETE": + { + await InvokeEventAsync(GuildJoinRequestDelete, () => new(data.ToObject(Serialization.Default.JsonGuildJoinRequestDeleteEventArgs))).ConfigureAwait(false); + } + break; default: { await InvokeEventAsync(UnknownEvent, () => new(name, data)).ConfigureAwait(false); diff --git a/NetCord/Gateway/GuildJoinRequest.cs b/NetCord/Gateway/GuildJoinRequest.cs new file mode 100644 index 000000000..5ee542a78 --- /dev/null +++ b/NetCord/Gateway/GuildJoinRequest.cs @@ -0,0 +1,25 @@ +using NetCord.Rest; + +namespace NetCord.Gateway; +public class GuildJoinRequest : IJsonModel +{ + private readonly JsonModels.JsonGuildJoinRequest _jsonModel; + JsonModels.JsonGuildJoinRequest IJsonModel.JsonModel => _jsonModel; + public GuildJoinRequestStatus ApplicationStatus => _jsonModel.ApplicationStatus; + public DateTimeOffset? CreatedAt => _jsonModel.CreatedAt; + public ulong GuildId => _jsonModel.GuildId; + public DateTimeOffset LastSeen => _jsonModel.LastSeen; + public string? RejectionReason => _jsonModel.RejectionReason; + public ulong UserId => _jsonModel.UserId; + public User User { get; } + public IReadOnlyList FormResponses { get; } + public User ActionedByUser { get; } + public ulong ActionedAt => _jsonModel.ActionedAt; + public GuildJoinRequest(JsonModels.JsonGuildJoinRequest jsonModel, RestClient client) + { + _jsonModel = jsonModel; + User = new User(jsonModel.User, client); + ActionedByUser = new User(jsonModel.ActionedByUser, client); + FormResponses = _jsonModel.FormResponses.Select(e => new VerificationField(e)).ToList(); + } +} diff --git a/NetCord/Gateway/GuildJoinRequestStatus.cs b/NetCord/Gateway/GuildJoinRequestStatus.cs new file mode 100644 index 000000000..762a446c1 --- /dev/null +++ b/NetCord/Gateway/GuildJoinRequestStatus.cs @@ -0,0 +1,15 @@ +using System.Text.Json.Serialization; + +namespace NetCord.Gateway; +[JsonConverter(typeof(JsonConverters.StringEnumConverterWithErrorHandling))] +public enum GuildJoinRequestStatus +{ + [JsonPropertyName("STARTED")] + Started, + [JsonPropertyName("PENDING")] + Pending, + [JsonPropertyName("REJECTED")] + Rejected, + [JsonPropertyName("APPROVED")] + Approved +} diff --git a/NetCord/Gateway/JsonModels/EventArgs/JsonGuildJoinRequestDeleteEventArgs.cs b/NetCord/Gateway/JsonModels/EventArgs/JsonGuildJoinRequestDeleteEventArgs.cs new file mode 100644 index 000000000..8d3b133f0 --- /dev/null +++ b/NetCord/Gateway/JsonModels/EventArgs/JsonGuildJoinRequestDeleteEventArgs.cs @@ -0,0 +1,13 @@ +using System.Text.Json.Serialization; + +namespace NetCord.Gateway.JsonModels.EventArgs; + +public class JsonGuildJoinRequestDeleteEventArgs +{ + [JsonPropertyName("id")] + public ulong Id { get; set; } + [JsonPropertyName("user_id")] + public ulong UserId { get; set; } + [JsonPropertyName("guild_id")] + public ulong GuildId { get; set; } +} diff --git a/NetCord/Gateway/JsonModels/EventArgs/JsonGuildJoinRequestUpdateEventArgs.cs b/NetCord/Gateway/JsonModels/EventArgs/JsonGuildJoinRequestUpdateEventArgs.cs new file mode 100644 index 000000000..a9cdf5618 --- /dev/null +++ b/NetCord/Gateway/JsonModels/EventArgs/JsonGuildJoinRequestUpdateEventArgs.cs @@ -0,0 +1,13 @@ +using System.Text.Json.Serialization; + +namespace NetCord.Gateway.JsonModels.EventArgs; + +public class JsonGuildJoinRequestUpdateEventArgs +{ + [JsonPropertyName("status")] + public GuildJoinRequestStatus Status { get; set; } + [JsonPropertyName("request")] + public JsonGuildJoinRequest Request { get; set; } + [JsonPropertyName("guild_id")] + public ulong GuildId { get; set; } +} diff --git a/NetCord/Gateway/JsonModels/JsonGuildJoinRequest.cs b/NetCord/Gateway/JsonModels/JsonGuildJoinRequest.cs new file mode 100644 index 000000000..cbd526d54 --- /dev/null +++ b/NetCord/Gateway/JsonModels/JsonGuildJoinRequest.cs @@ -0,0 +1,37 @@ +using System.Text.Json.Serialization; + +using NetCord.JsonModels; + +namespace NetCord.Gateway.JsonModels; +public class JsonGuildJoinRequest : JsonEntity +{ + [JsonPropertyName("application_status")] + public GuildJoinRequestStatus ApplicationStatus { get; set; } + + [JsonPropertyName("created_at")] + public DateTimeOffset CreatedAt { get; set; } + + [JsonPropertyName("guild_id")] + public ulong GuildId { get; set; } + + [JsonPropertyName("last_seen")] + public DateTimeOffset LastSeen { get; set; } + + [JsonPropertyName("rejection_reason")] + public string? RejectionReason { get; set; } + + [JsonPropertyName("user_id")] + public ulong UserId { get; set; } + + [JsonPropertyName("user")] + public JsonUser User { get; set; } + + [JsonPropertyName("form_responses")] + public IReadOnlyList FormResponses { get; set; } + + [JsonPropertyName("actioned_by_user")] + public JsonUser ActionedByUser { get; set; } + + [JsonPropertyName("actioned_at")] + public ulong ActionedAt { get; set; } +} diff --git a/NetCord/Gateway/JsonModels/JsonVerificationField.cs b/NetCord/Gateway/JsonModels/JsonVerificationField.cs new file mode 100644 index 000000000..b104075b8 --- /dev/null +++ b/NetCord/Gateway/JsonModels/JsonVerificationField.cs @@ -0,0 +1,20 @@ +using System.Text.Json.Serialization; + +namespace NetCord.Gateway.JsonModels; +public partial class JsonVerificationField +{ + [JsonPropertyName("field_type")] + public VerificationFieldType FieldType { get; set; } + + [JsonPropertyName("label")] + public string Label { get; set; } + + [JsonPropertyName("required")] + public bool Required { get; set; } + + [JsonPropertyName("response")] + public bool Response { get; set; } + + [JsonPropertyName("values")] + public IReadOnlyList Values { get; set; } +} diff --git a/NetCord/Gateway/VerificationField.cs b/NetCord/Gateway/VerificationField.cs new file mode 100644 index 000000000..655ecc79c --- /dev/null +++ b/NetCord/Gateway/VerificationField.cs @@ -0,0 +1,12 @@ +namespace NetCord.Gateway; + +public class VerificationField(JsonModels.JsonVerificationField jsonModel) : IJsonModel +{ + private readonly JsonModels.JsonVerificationField _jsonModel = jsonModel; + JsonModels.JsonVerificationField IJsonModel.JsonModel => _jsonModel; + public VerificationFieldType FieldType => _jsonModel.FieldType; + public string Label => _jsonModel.Label; + public bool Required => _jsonModel.Required; + public bool IsResponse => _jsonModel.Response; + public IReadOnlyList Values => _jsonModel.Values; +} diff --git a/NetCord/Gateway/VerificationFieldType.cs b/NetCord/Gateway/VerificationFieldType.cs new file mode 100644 index 000000000..49690d9ca --- /dev/null +++ b/NetCord/Gateway/VerificationFieldType.cs @@ -0,0 +1,19 @@ +using System.Text.Json.Serialization; + +namespace NetCord.Gateway; +[JsonConverter(typeof(JsonConverters.StringEnumConverterWithErrorHandling))] +public enum VerificationFieldType +{ + [JsonPropertyName("TERMS")] + Terms, + [JsonPropertyName("TEXT_INPUT")] + TextInput, + [JsonPropertyName("PARAGRAPH")] + Paragraph, + [JsonPropertyName("MULTIPLE_CHOICE")] + MultipleChoise, + [JsonPropertyName("VERIFICATION")] + Verification, + [JsonPropertyName("FILE_UPLOAD")] + FileUpload +} diff --git a/NetCord/Serialization.cs b/NetCord/Serialization.cs index af4717dd1..5c7763ea7 100644 --- a/NetCord/Serialization.cs +++ b/NetCord/Serialization.cs @@ -223,6 +223,12 @@ namespace NetCord; [JsonSerializable(typeof(GuildUsersSearchTimestamp))] [JsonSerializable(typeof(JsonGuildUserSearchResult))] [JsonSerializable(typeof(GuildUsersSearchPaginationProperties))] +[JsonSerializable(typeof(IReadOnlyList))] +[JsonSerializable(typeof(JsonVerificationField))] +[JsonSerializable(typeof(IReadOnlyList))] +[JsonSerializable(typeof(JsonGuildJoinRequest))] +[JsonSerializable(typeof(JsonGuildJoinRequestUpdateEventArgs))] +[JsonSerializable(typeof(JsonGuildJoinRequestDeleteEventArgs))] internal partial class Serialization : JsonSerializerContext { } From 23a5b3eaab58a06e9cc736ab7efa3cc0722d81fa Mon Sep 17 00:00:00 2001 From: Kuba_Z2 <77853483+KubaZ2@users.noreply.github.com> Date: Sat, 23 Mar 2024 23:18:36 +0100 Subject: [PATCH 02/19] Update NetCord/Gateway/GatewayClient.cs --- NetCord/Gateway/GatewayClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NetCord/Gateway/GatewayClient.cs b/NetCord/Gateway/GatewayClient.cs index a3610cc28..e6eceb95d 100644 --- a/NetCord/Gateway/GatewayClient.cs +++ b/NetCord/Gateway/GatewayClient.cs @@ -80,9 +80,9 @@ public partial class GatewayClient : WebSocketClient, IEntity public event Func? EntitlementCreate; public event Func? EntitlementUpdate; public event Func? EntitlementDelete; - public event Func? UnknownEvent; public event Func? GuildJoinRequestUpdate; public event Func? GuildJoinRequestDelete; + public event Func? UnknownEvent; /// /// The token of the . From 23250f589c206f1045cde91419d99b70e14e31e7 Mon Sep 17 00:00:00 2001 From: Kuba_Z2 <77853483+KubaZ2@users.noreply.github.com> Date: Sat, 23 Mar 2024 23:18:42 +0100 Subject: [PATCH 03/19] Update NetCord/Gateway/GuildJoinRequestStatus.cs --- NetCord/Gateway/GuildJoinRequestStatus.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/NetCord/Gateway/GuildJoinRequestStatus.cs b/NetCord/Gateway/GuildJoinRequestStatus.cs index 762a446c1..d2ead9ac1 100644 --- a/NetCord/Gateway/GuildJoinRequestStatus.cs +++ b/NetCord/Gateway/GuildJoinRequestStatus.cs @@ -1,6 +1,7 @@ using System.Text.Json.Serialization; namespace NetCord.Gateway; + [JsonConverter(typeof(JsonConverters.StringEnumConverterWithErrorHandling))] public enum GuildJoinRequestStatus { From bf4ed2e1cfd26f4d29563e1283a497c02346cc3a Mon Sep 17 00:00:00 2001 From: Kuba_Z2 <77853483+KubaZ2@users.noreply.github.com> Date: Sat, 23 Mar 2024 23:18:46 +0100 Subject: [PATCH 04/19] Update NetCord/Gateway/GuildJoinRequestStatus.cs --- NetCord/Gateway/GuildJoinRequestStatus.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NetCord/Gateway/GuildJoinRequestStatus.cs b/NetCord/Gateway/GuildJoinRequestStatus.cs index d2ead9ac1..39e8e3bf8 100644 --- a/NetCord/Gateway/GuildJoinRequestStatus.cs +++ b/NetCord/Gateway/GuildJoinRequestStatus.cs @@ -12,5 +12,5 @@ public enum GuildJoinRequestStatus [JsonPropertyName("REJECTED")] Rejected, [JsonPropertyName("APPROVED")] - Approved + Approved, } From cbe8a6659fce0f6ef0038d5040accd4361223e37 Mon Sep 17 00:00:00 2001 From: Kuba_Z2 <77853483+KubaZ2@users.noreply.github.com> Date: Sat, 23 Mar 2024 23:18:51 +0100 Subject: [PATCH 05/19] Update NetCord/Gateway/JsonModels/EventArgs/JsonGuildJoinRequestDeleteEventArgs.cs --- .../JsonModels/EventArgs/JsonGuildJoinRequestDeleteEventArgs.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NetCord/Gateway/JsonModels/EventArgs/JsonGuildJoinRequestDeleteEventArgs.cs b/NetCord/Gateway/JsonModels/EventArgs/JsonGuildJoinRequestDeleteEventArgs.cs index 8d3b133f0..5d338b294 100644 --- a/NetCord/Gateway/JsonModels/EventArgs/JsonGuildJoinRequestDeleteEventArgs.cs +++ b/NetCord/Gateway/JsonModels/EventArgs/JsonGuildJoinRequestDeleteEventArgs.cs @@ -6,8 +6,10 @@ public class JsonGuildJoinRequestDeleteEventArgs { [JsonPropertyName("id")] public ulong Id { get; set; } + [JsonPropertyName("user_id")] public ulong UserId { get; set; } + [JsonPropertyName("guild_id")] public ulong GuildId { get; set; } } From df34fdee06c1c6951860d175c9f906cdd015d7b7 Mon Sep 17 00:00:00 2001 From: Kuba_Z2 <77853483+KubaZ2@users.noreply.github.com> Date: Sat, 23 Mar 2024 23:18:55 +0100 Subject: [PATCH 06/19] Update NetCord/Gateway/JsonModels/JsonGuildJoinRequest.cs --- NetCord/Gateway/JsonModels/JsonGuildJoinRequest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NetCord/Gateway/JsonModels/JsonGuildJoinRequest.cs b/NetCord/Gateway/JsonModels/JsonGuildJoinRequest.cs index cbd526d54..6c678b3be 100644 --- a/NetCord/Gateway/JsonModels/JsonGuildJoinRequest.cs +++ b/NetCord/Gateway/JsonModels/JsonGuildJoinRequest.cs @@ -15,7 +15,7 @@ public class JsonGuildJoinRequest : JsonEntity public ulong GuildId { get; set; } [JsonPropertyName("last_seen")] - public DateTimeOffset LastSeen { get; set; } + public DateTimeOffset LastSeenAt { get; set; } [JsonPropertyName("rejection_reason")] public string? RejectionReason { get; set; } From e26d4583db7d8f318aea422222bc90edc6e85504 Mon Sep 17 00:00:00 2001 From: Kuba_Z2 <77853483+KubaZ2@users.noreply.github.com> Date: Sat, 23 Mar 2024 23:19:00 +0100 Subject: [PATCH 07/19] Update NetCord/Gateway/GuildJoinRequest.cs --- NetCord/Gateway/GuildJoinRequest.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/NetCord/Gateway/GuildJoinRequest.cs b/NetCord/Gateway/GuildJoinRequest.cs index 5ee542a78..ac285d582 100644 --- a/NetCord/Gateway/GuildJoinRequest.cs +++ b/NetCord/Gateway/GuildJoinRequest.cs @@ -15,6 +15,7 @@ public class GuildJoinRequest : IJsonModel public IReadOnlyList FormResponses { get; } public User ActionedByUser { get; } public ulong ActionedAt => _jsonModel.ActionedAt; + public GuildJoinRequest(JsonModels.JsonGuildJoinRequest jsonModel, RestClient client) { _jsonModel = jsonModel; From 89eed676a4caaa83ff7d7353a5eb523ed0ee4d21 Mon Sep 17 00:00:00 2001 From: Kuba_Z2 <77853483+KubaZ2@users.noreply.github.com> Date: Sat, 23 Mar 2024 23:19:07 +0100 Subject: [PATCH 08/19] Update NetCord/Gateway/JsonModels/JsonGuildJoinRequest.cs --- NetCord/Gateway/JsonModels/JsonGuildJoinRequest.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/NetCord/Gateway/JsonModels/JsonGuildJoinRequest.cs b/NetCord/Gateway/JsonModels/JsonGuildJoinRequest.cs index 6c678b3be..7a5cc2e75 100644 --- a/NetCord/Gateway/JsonModels/JsonGuildJoinRequest.cs +++ b/NetCord/Gateway/JsonModels/JsonGuildJoinRequest.cs @@ -3,6 +3,7 @@ using NetCord.JsonModels; namespace NetCord.Gateway.JsonModels; + public class JsonGuildJoinRequest : JsonEntity { [JsonPropertyName("application_status")] From 4a51f83a282e12c6347bc1d8c167ba94d5c9643b Mon Sep 17 00:00:00 2001 From: Kuba_Z2 <77853483+KubaZ2@users.noreply.github.com> Date: Sat, 23 Mar 2024 23:19:14 +0100 Subject: [PATCH 09/19] Update NetCord/Gateway/JsonModels/JsonVerificationField.cs --- NetCord/Gateway/JsonModels/JsonVerificationField.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/NetCord/Gateway/JsonModels/JsonVerificationField.cs b/NetCord/Gateway/JsonModels/JsonVerificationField.cs index b104075b8..c940e73a9 100644 --- a/NetCord/Gateway/JsonModels/JsonVerificationField.cs +++ b/NetCord/Gateway/JsonModels/JsonVerificationField.cs @@ -1,6 +1,7 @@ using System.Text.Json.Serialization; namespace NetCord.Gateway.JsonModels; + public partial class JsonVerificationField { [JsonPropertyName("field_type")] From f1cdd22a6f864c6b25593dd4ac5d8f978bb77e16 Mon Sep 17 00:00:00 2001 From: Kuba_Z2 <77853483+KubaZ2@users.noreply.github.com> Date: Sat, 23 Mar 2024 23:19:27 +0100 Subject: [PATCH 10/19] Update NetCord/Gateway/GuildJoinRequest.cs --- NetCord/Gateway/GuildJoinRequest.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/NetCord/Gateway/GuildJoinRequest.cs b/NetCord/Gateway/GuildJoinRequest.cs index ac285d582..9296fe173 100644 --- a/NetCord/Gateway/GuildJoinRequest.cs +++ b/NetCord/Gateway/GuildJoinRequest.cs @@ -1,6 +1,7 @@ using NetCord.Rest; namespace NetCord.Gateway; + public class GuildJoinRequest : IJsonModel { private readonly JsonModels.JsonGuildJoinRequest _jsonModel; From 6ab9805a9af1130ec4728f3bfa0fc729568ec1d4 Mon Sep 17 00:00:00 2001 From: Kuba_Z2 <77853483+KubaZ2@users.noreply.github.com> Date: Sat, 23 Mar 2024 23:19:58 +0100 Subject: [PATCH 11/19] Apply suggestions from code review --- NetCord/Gateway/GuildJoinRequest.cs | 5 +++-- NetCord/Gateway/VerificationField.cs | 14 +++++++------- NetCord/Gateway/VerificationFieldType.cs | 5 +++-- NetCord/Serialization.cs | 4 ---- 4 files changed, 13 insertions(+), 15 deletions(-) diff --git a/NetCord/Gateway/GuildJoinRequest.cs b/NetCord/Gateway/GuildJoinRequest.cs index 9296fe173..0f9c268ce 100644 --- a/NetCord/Gateway/GuildJoinRequest.cs +++ b/NetCord/Gateway/GuildJoinRequest.cs @@ -6,10 +6,11 @@ public class GuildJoinRequest : IJsonModel { private readonly JsonModels.JsonGuildJoinRequest _jsonModel; JsonModels.JsonGuildJoinRequest IJsonModel.JsonModel => _jsonModel; + public GuildJoinRequestStatus ApplicationStatus => _jsonModel.ApplicationStatus; public DateTimeOffset? CreatedAt => _jsonModel.CreatedAt; public ulong GuildId => _jsonModel.GuildId; - public DateTimeOffset LastSeen => _jsonModel.LastSeen; + public DateTimeOffset LastSeenAt => _jsonModel.LastSeenAt; public string? RejectionReason => _jsonModel.RejectionReason; public ulong UserId => _jsonModel.UserId; public User User { get; } @@ -22,6 +23,6 @@ public GuildJoinRequest(JsonModels.JsonGuildJoinRequest jsonModel, RestClient cl _jsonModel = jsonModel; User = new User(jsonModel.User, client); ActionedByUser = new User(jsonModel.ActionedByUser, client); - FormResponses = _jsonModel.FormResponses.Select(e => new VerificationField(e)).ToList(); + FormResponses = _jsonModel.FormResponses.Select(e => new VerificationField(e)).ToArray(); } } diff --git a/NetCord/Gateway/VerificationField.cs b/NetCord/Gateway/VerificationField.cs index 655ecc79c..c306682e5 100644 --- a/NetCord/Gateway/VerificationField.cs +++ b/NetCord/Gateway/VerificationField.cs @@ -2,11 +2,11 @@ public class VerificationField(JsonModels.JsonVerificationField jsonModel) : IJsonModel { - private readonly JsonModels.JsonVerificationField _jsonModel = jsonModel; - JsonModels.JsonVerificationField IJsonModel.JsonModel => _jsonModel; - public VerificationFieldType FieldType => _jsonModel.FieldType; - public string Label => _jsonModel.Label; - public bool Required => _jsonModel.Required; - public bool IsResponse => _jsonModel.Response; - public IReadOnlyList Values => _jsonModel.Values; + JsonModels.JsonVerificationField IJsonModel.JsonModel => jsonModel; + + public VerificationFieldType FieldType => jsonModel.FieldType; + public string Label => jsonModel.Label; + public bool Required => jsonModel.Required; + public bool IsResponse => jsonModel.Response; + public IReadOnlyList Values => jsonModel.Values; } diff --git a/NetCord/Gateway/VerificationFieldType.cs b/NetCord/Gateway/VerificationFieldType.cs index 49690d9ca..a5256f268 100644 --- a/NetCord/Gateway/VerificationFieldType.cs +++ b/NetCord/Gateway/VerificationFieldType.cs @@ -1,6 +1,7 @@ using System.Text.Json.Serialization; namespace NetCord.Gateway; + [JsonConverter(typeof(JsonConverters.StringEnumConverterWithErrorHandling))] public enum VerificationFieldType { @@ -11,9 +12,9 @@ public enum VerificationFieldType [JsonPropertyName("PARAGRAPH")] Paragraph, [JsonPropertyName("MULTIPLE_CHOICE")] - MultipleChoise, + MultipleChoice, [JsonPropertyName("VERIFICATION")] Verification, [JsonPropertyName("FILE_UPLOAD")] - FileUpload + FileUpload, } diff --git a/NetCord/Serialization.cs b/NetCord/Serialization.cs index 5c7763ea7..f85c7689a 100644 --- a/NetCord/Serialization.cs +++ b/NetCord/Serialization.cs @@ -223,10 +223,6 @@ namespace NetCord; [JsonSerializable(typeof(GuildUsersSearchTimestamp))] [JsonSerializable(typeof(JsonGuildUserSearchResult))] [JsonSerializable(typeof(GuildUsersSearchPaginationProperties))] -[JsonSerializable(typeof(IReadOnlyList))] -[JsonSerializable(typeof(JsonVerificationField))] -[JsonSerializable(typeof(IReadOnlyList))] -[JsonSerializable(typeof(JsonGuildJoinRequest))] [JsonSerializable(typeof(JsonGuildJoinRequestUpdateEventArgs))] [JsonSerializable(typeof(JsonGuildJoinRequestDeleteEventArgs))] internal partial class Serialization : JsonSerializerContext From 7ab50d54d5ed8e4de5ab2280960cb84046b05adc Mon Sep 17 00:00:00 2001 From: KubaZ2 Date: Sun, 24 Mar 2024 18:53:28 +0100 Subject: [PATCH 12/19] Add new lines --- .../JsonModels/EventArgs/JsonGuildJoinRequestUpdateEventArgs.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NetCord/Gateway/JsonModels/EventArgs/JsonGuildJoinRequestUpdateEventArgs.cs b/NetCord/Gateway/JsonModels/EventArgs/JsonGuildJoinRequestUpdateEventArgs.cs index a9cdf5618..387ad4a12 100644 --- a/NetCord/Gateway/JsonModels/EventArgs/JsonGuildJoinRequestUpdateEventArgs.cs +++ b/NetCord/Gateway/JsonModels/EventArgs/JsonGuildJoinRequestUpdateEventArgs.cs @@ -6,8 +6,10 @@ public class JsonGuildJoinRequestUpdateEventArgs { [JsonPropertyName("status")] public GuildJoinRequestStatus Status { get; set; } + [JsonPropertyName("request")] public JsonGuildJoinRequest Request { get; set; } + [JsonPropertyName("guild_id")] public ulong GuildId { get; set; } } From 5023062da9436718bc4466d0ed0daab4fc8bc1b4 Mon Sep 17 00:00:00 2001 From: KubaZ2 Date: Sun, 24 Mar 2024 18:53:54 +0100 Subject: [PATCH 13/19] Use a primary constructor --- NetCord/Gateway/GuildJoinRequest.cs | 33 +++++++++++------------------ 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/NetCord/Gateway/GuildJoinRequest.cs b/NetCord/Gateway/GuildJoinRequest.cs index 0f9c268ce..9bc51ab51 100644 --- a/NetCord/Gateway/GuildJoinRequest.cs +++ b/NetCord/Gateway/GuildJoinRequest.cs @@ -2,27 +2,18 @@ namespace NetCord.Gateway; -public class GuildJoinRequest : IJsonModel +public class GuildJoinRequest(JsonModels.JsonGuildJoinRequest jsonModel, RestClient client) : IJsonModel { - private readonly JsonModels.JsonGuildJoinRequest _jsonModel; - JsonModels.JsonGuildJoinRequest IJsonModel.JsonModel => _jsonModel; + JsonModels.JsonGuildJoinRequest IJsonModel.JsonModel => jsonModel; - public GuildJoinRequestStatus ApplicationStatus => _jsonModel.ApplicationStatus; - public DateTimeOffset? CreatedAt => _jsonModel.CreatedAt; - public ulong GuildId => _jsonModel.GuildId; - public DateTimeOffset LastSeenAt => _jsonModel.LastSeenAt; - public string? RejectionReason => _jsonModel.RejectionReason; - public ulong UserId => _jsonModel.UserId; - public User User { get; } - public IReadOnlyList FormResponses { get; } - public User ActionedByUser { get; } - public ulong ActionedAt => _jsonModel.ActionedAt; - - public GuildJoinRequest(JsonModels.JsonGuildJoinRequest jsonModel, RestClient client) - { - _jsonModel = jsonModel; - User = new User(jsonModel.User, client); - ActionedByUser = new User(jsonModel.ActionedByUser, client); - FormResponses = _jsonModel.FormResponses.Select(e => new VerificationField(e)).ToArray(); - } + public GuildJoinRequestStatus ApplicationStatus => jsonModel.ApplicationStatus; + public DateTimeOffset CreatedAt => jsonModel.CreatedAt; + public ulong GuildId => jsonModel.GuildId; + public DateTimeOffset LastSeenAt => jsonModel.LastSeenAt; + public string? RejectionReason => jsonModel.RejectionReason; + public ulong UserId => jsonModel.UserId; + public User User { get; } = new(jsonModel.User, client); + public IReadOnlyList FormResponses { get; } = jsonModel.FormResponses.Select(e => new VerificationField(e)).ToArray(); + public User ActionedByUser { get; } = new(jsonModel.ActionedByUser, client); + public ulong ActionedAt => jsonModel.ActionedAt; } From ea30ce4320c462f6f82da4e170a18c845e099aa3 Mon Sep 17 00:00:00 2001 From: KubaZ2 Date: Sun, 24 Mar 2024 18:57:16 +0100 Subject: [PATCH 14/19] Add the `GuildJoinRequestUpdate` and `GuildJoinRequestDelete` to `ShardedGatewayClient` --- NetCord/Gateway/ShardedGatewayClient.cs | 30 +++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/NetCord/Gateway/ShardedGatewayClient.cs b/NetCord/Gateway/ShardedGatewayClient.cs index 070edd8fc..22bbfad4e 100644 --- a/NetCord/Gateway/ShardedGatewayClient.cs +++ b/NetCord/Gateway/ShardedGatewayClient.cs @@ -326,6 +326,8 @@ private void HookEvents(GatewayClient client) HookEvent(client, _entitlementCreateLock, ref _entitlementCreate, a => _entitlementCreate!(client, a), (c, e) => c.EntitlementCreate += e); HookEvent(client, _entitlementUpdateLock, ref _entitlementUpdate, a => _entitlementUpdate!(client, a), (c, e) => c.EntitlementUpdate += e); HookEvent(client, _entitlementDeleteLock, ref _entitlementDelete, a => _entitlementDelete!(client, a), (c, e) => c.EntitlementDelete += e); + HookEvent(client, _guildJoinRequestUpdateLock, ref _guildJoinRequestUpdate, a => _guildJoinRequestUpdate!(client, a), (c, e) => c.GuildJoinRequestUpdate += e); + HookEvent(client, _guildJoinRequestDeleteLock, ref _guildJoinRequestDelete, a => _guildJoinRequestDelete!(client, a), (c, e) => c.GuildJoinRequestDelete += e); HookEvent(client, _unknownEventLock, ref _unknownEvent, a => _unknownEvent!(client, a), (c, e) => c.UnknownEvent += e); } @@ -1309,6 +1311,34 @@ public event Func? EntitlementDelete } } + private readonly object _guildJoinRequestUpdateLock = new(); + private Func? _guildJoinRequestUpdate; + public event Func? GuildJoinRequestUpdate + { + add + { + HookEvent(_guildJoinRequestUpdateLock, value, ref _guildJoinRequestUpdate, client => a => _guildJoinRequestUpdate!(client, a), (c, e) => c.GuildJoinRequestUpdate += e); + } + remove + { + UnhookEvent(_guildJoinRequestUpdateLock, value, ref _guildJoinRequestUpdate, (c, e) => c.GuildJoinRequestUpdate -= e); + } + } + + private readonly object _guildJoinRequestDeleteLock = new(); + private Func? _guildJoinRequestDelete; + public event Func? GuildJoinRequestDelete + { + add + { + HookEvent(_guildJoinRequestDeleteLock, value, ref _guildJoinRequestDelete, client => a => _guildJoinRequestDelete!(client, a), (c, e) => c.GuildJoinRequestDelete += e); + } + remove + { + UnhookEvent(_guildJoinRequestDeleteLock, value, ref _guildJoinRequestDelete, (c, e) => c.GuildJoinRequestDelete -= e); + } + } + private readonly object _unknownEventLock = new(); private Func? _unknownEvent; public event Func? UnknownEvent From e5917a6005869608007f4ba4566b530adc619834 Mon Sep 17 00:00:00 2001 From: KubaZ2 Date: Sun, 24 Mar 2024 19:26:32 +0100 Subject: [PATCH 15/19] Refactor `GuildJoinRequest.CreatedAt` and add missing `Id` property --- NetCord/Gateway/GuildJoinRequest.cs | 7 ++++--- NetCord/Gateway/JsonModels/JsonGuildJoinRequest.cs | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/NetCord/Gateway/GuildJoinRequest.cs b/NetCord/Gateway/GuildJoinRequest.cs index 9bc51ab51..b2481614c 100644 --- a/NetCord/Gateway/GuildJoinRequest.cs +++ b/NetCord/Gateway/GuildJoinRequest.cs @@ -2,12 +2,13 @@ namespace NetCord.Gateway; -public class GuildJoinRequest(JsonModels.JsonGuildJoinRequest jsonModel, RestClient client) : IJsonModel +public class GuildJoinRequest(JsonModels.JsonGuildJoinRequest jsonModel, RestClient client) : Entity, IJsonModel { JsonModels.JsonGuildJoinRequest IJsonModel.JsonModel => jsonModel; - + + public override ulong Id => jsonModel.Id; public GuildJoinRequestStatus ApplicationStatus => jsonModel.ApplicationStatus; - public DateTimeOffset CreatedAt => jsonModel.CreatedAt; + //public DateTimeOffset CreatedAt => jsonModel.CreatedAt; public ulong GuildId => jsonModel.GuildId; public DateTimeOffset LastSeenAt => jsonModel.LastSeenAt; public string? RejectionReason => jsonModel.RejectionReason; diff --git a/NetCord/Gateway/JsonModels/JsonGuildJoinRequest.cs b/NetCord/Gateway/JsonModels/JsonGuildJoinRequest.cs index 7a5cc2e75..7b31cae0a 100644 --- a/NetCord/Gateway/JsonModels/JsonGuildJoinRequest.cs +++ b/NetCord/Gateway/JsonModels/JsonGuildJoinRequest.cs @@ -9,8 +9,8 @@ public class JsonGuildJoinRequest : JsonEntity [JsonPropertyName("application_status")] public GuildJoinRequestStatus ApplicationStatus { get; set; } - [JsonPropertyName("created_at")] - public DateTimeOffset CreatedAt { get; set; } + //[JsonPropertyName("created_at")] + //public DateTimeOffset CreatedAt { get; set; } [JsonPropertyName("guild_id")] public ulong GuildId { get; set; } From a934db4f14e8532811b1fa596497fb8116829d98 Mon Sep 17 00:00:00 2001 From: KubaZ2 Date: Sun, 24 Mar 2024 19:29:53 +0100 Subject: [PATCH 16/19] Rename `VerificationField` to `GuildJoinRequestFormResponse` --- NetCord/Gateway/GuildJoinRequest.cs | 2 +- NetCord/Gateway/GuildJoinRequestFormResponse.cs | 12 ++++++++++++ ...e.cs => GuildJoinRequestFormResponseFieldType.cs} | 4 ++-- NetCord/Gateway/JsonModels/JsonGuildJoinRequest.cs | 2 +- ...nField.cs => JsonGuildJoinRequestFormResponse.cs} | 4 ++-- NetCord/Gateway/VerificationField.cs | 12 ------------ 6 files changed, 18 insertions(+), 18 deletions(-) create mode 100644 NetCord/Gateway/GuildJoinRequestFormResponse.cs rename NetCord/Gateway/{VerificationFieldType.cs => GuildJoinRequestFormResponseFieldType.cs} (81%) rename NetCord/Gateway/JsonModels/{JsonVerificationField.cs => JsonGuildJoinRequestFormResponse.cs} (77%) delete mode 100644 NetCord/Gateway/VerificationField.cs diff --git a/NetCord/Gateway/GuildJoinRequest.cs b/NetCord/Gateway/GuildJoinRequest.cs index b2481614c..e4a00b8ad 100644 --- a/NetCord/Gateway/GuildJoinRequest.cs +++ b/NetCord/Gateway/GuildJoinRequest.cs @@ -14,7 +14,7 @@ public class GuildJoinRequest(JsonModels.JsonGuildJoinRequest jsonModel, RestCli public string? RejectionReason => jsonModel.RejectionReason; public ulong UserId => jsonModel.UserId; public User User { get; } = new(jsonModel.User, client); - public IReadOnlyList FormResponses { get; } = jsonModel.FormResponses.Select(e => new VerificationField(e)).ToArray(); + public IReadOnlyList FormResponses { get; } = jsonModel.FormResponses.Select(e => new GuildJoinRequestFormResponse(e)).ToArray(); public User ActionedByUser { get; } = new(jsonModel.ActionedByUser, client); public ulong ActionedAt => jsonModel.ActionedAt; } diff --git a/NetCord/Gateway/GuildJoinRequestFormResponse.cs b/NetCord/Gateway/GuildJoinRequestFormResponse.cs new file mode 100644 index 000000000..6da263842 --- /dev/null +++ b/NetCord/Gateway/GuildJoinRequestFormResponse.cs @@ -0,0 +1,12 @@ +namespace NetCord.Gateway; + +public class GuildJoinRequestFormResponse(JsonModels.JsonGuildJoinRequestFormResponse jsonModel) : IJsonModel +{ + JsonModels.JsonGuildJoinRequestFormResponse IJsonModel.JsonModel => jsonModel; + + public GuildJoinRequestFormResponseFieldType FieldType => jsonModel.FieldType; + public string Label => jsonModel.Label; + public bool Required => jsonModel.Required; + public bool IsResponse => jsonModel.Response; + public IReadOnlyList Values => jsonModel.Values; +} diff --git a/NetCord/Gateway/VerificationFieldType.cs b/NetCord/Gateway/GuildJoinRequestFormResponseFieldType.cs similarity index 81% rename from NetCord/Gateway/VerificationFieldType.cs rename to NetCord/Gateway/GuildJoinRequestFormResponseFieldType.cs index a5256f268..0cf645ae2 100644 --- a/NetCord/Gateway/VerificationFieldType.cs +++ b/NetCord/Gateway/GuildJoinRequestFormResponseFieldType.cs @@ -2,8 +2,8 @@ namespace NetCord.Gateway; -[JsonConverter(typeof(JsonConverters.StringEnumConverterWithErrorHandling))] -public enum VerificationFieldType +[JsonConverter(typeof(JsonConverters.StringEnumConverterWithErrorHandling))] +public enum GuildJoinRequestFormResponseFieldType { [JsonPropertyName("TERMS")] Terms, diff --git a/NetCord/Gateway/JsonModels/JsonGuildJoinRequest.cs b/NetCord/Gateway/JsonModels/JsonGuildJoinRequest.cs index 7b31cae0a..221b39fb6 100644 --- a/NetCord/Gateway/JsonModels/JsonGuildJoinRequest.cs +++ b/NetCord/Gateway/JsonModels/JsonGuildJoinRequest.cs @@ -28,7 +28,7 @@ public class JsonGuildJoinRequest : JsonEntity public JsonUser User { get; set; } [JsonPropertyName("form_responses")] - public IReadOnlyList FormResponses { get; set; } + public IReadOnlyList FormResponses { get; set; } [JsonPropertyName("actioned_by_user")] public JsonUser ActionedByUser { get; set; } diff --git a/NetCord/Gateway/JsonModels/JsonVerificationField.cs b/NetCord/Gateway/JsonModels/JsonGuildJoinRequestFormResponse.cs similarity index 77% rename from NetCord/Gateway/JsonModels/JsonVerificationField.cs rename to NetCord/Gateway/JsonModels/JsonGuildJoinRequestFormResponse.cs index c940e73a9..e808eebce 100644 --- a/NetCord/Gateway/JsonModels/JsonVerificationField.cs +++ b/NetCord/Gateway/JsonModels/JsonGuildJoinRequestFormResponse.cs @@ -2,10 +2,10 @@ namespace NetCord.Gateway.JsonModels; -public partial class JsonVerificationField +public partial class JsonGuildJoinRequestFormResponse { [JsonPropertyName("field_type")] - public VerificationFieldType FieldType { get; set; } + public GuildJoinRequestFormResponseFieldType FieldType { get; set; } [JsonPropertyName("label")] public string Label { get; set; } diff --git a/NetCord/Gateway/VerificationField.cs b/NetCord/Gateway/VerificationField.cs deleted file mode 100644 index c306682e5..000000000 --- a/NetCord/Gateway/VerificationField.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace NetCord.Gateway; - -public class VerificationField(JsonModels.JsonVerificationField jsonModel) : IJsonModel -{ - JsonModels.JsonVerificationField IJsonModel.JsonModel => jsonModel; - - public VerificationFieldType FieldType => jsonModel.FieldType; - public string Label => jsonModel.Label; - public bool Required => jsonModel.Required; - public bool IsResponse => jsonModel.Response; - public IReadOnlyList Values => jsonModel.Values; -} From 6f43c55d6fd5c8f29567ed69fa6d81150cefc418 Mon Sep 17 00:00:00 2001 From: KubaZ2 Date: Sun, 24 Mar 2024 19:41:21 +0100 Subject: [PATCH 17/19] Rename `JsonGuildJoinRequestDeleteEventArgs.Id` to `JoinRequestId` --- NetCord/Gateway/EventArgs/GuildJoinRequestDeleteEventArgs.cs | 2 +- .../JsonModels/EventArgs/JsonGuildJoinRequestDeleteEventArgs.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/NetCord/Gateway/EventArgs/GuildJoinRequestDeleteEventArgs.cs b/NetCord/Gateway/EventArgs/GuildJoinRequestDeleteEventArgs.cs index 2d30b863e..7184fadd3 100644 --- a/NetCord/Gateway/EventArgs/GuildJoinRequestDeleteEventArgs.cs +++ b/NetCord/Gateway/EventArgs/GuildJoinRequestDeleteEventArgs.cs @@ -4,7 +4,7 @@ public class GuildJoinRequestDeleteEventArgs(JsonModels.EventArgs.JsonGuildJoinR { JsonModels.EventArgs.JsonGuildJoinRequestDeleteEventArgs IJsonModel.JsonModel => jsonModel; - public ulong JoinRequestId => jsonModel.Id; + public ulong JoinRequestId => jsonModel.JoinRequestId; public ulong UserId => jsonModel.UserId; diff --git a/NetCord/Gateway/JsonModels/EventArgs/JsonGuildJoinRequestDeleteEventArgs.cs b/NetCord/Gateway/JsonModels/EventArgs/JsonGuildJoinRequestDeleteEventArgs.cs index 5d338b294..f91b8b5d3 100644 --- a/NetCord/Gateway/JsonModels/EventArgs/JsonGuildJoinRequestDeleteEventArgs.cs +++ b/NetCord/Gateway/JsonModels/EventArgs/JsonGuildJoinRequestDeleteEventArgs.cs @@ -5,7 +5,7 @@ namespace NetCord.Gateway.JsonModels.EventArgs; public class JsonGuildJoinRequestDeleteEventArgs { [JsonPropertyName("id")] - public ulong Id { get; set; } + public ulong JoinRequestId { get; set; } [JsonPropertyName("user_id")] public ulong UserId { get; set; } From 812ecef3a4cdec0bba65ab3d48d9058e3a7962cc Mon Sep 17 00:00:00 2001 From: KubaZ2 Date: Sun, 24 Mar 2024 19:41:35 +0100 Subject: [PATCH 18/19] Add `JsonGuildJoinRequestFormResponse.Description` --- NetCord/Gateway/JsonModels/JsonGuildJoinRequestFormResponse.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/NetCord/Gateway/JsonModels/JsonGuildJoinRequestFormResponse.cs b/NetCord/Gateway/JsonModels/JsonGuildJoinRequestFormResponse.cs index e808eebce..c6b775622 100644 --- a/NetCord/Gateway/JsonModels/JsonGuildJoinRequestFormResponse.cs +++ b/NetCord/Gateway/JsonModels/JsonGuildJoinRequestFormResponse.cs @@ -10,6 +10,9 @@ public partial class JsonGuildJoinRequestFormResponse [JsonPropertyName("label")] public string Label { get; set; } + [JsonPropertyName("description")] + public string? Description { get; set; } + [JsonPropertyName("required")] public bool Required { get; set; } From a440d9d4144c3856714f02ff7201d6284c28cf9e Mon Sep 17 00:00:00 2001 From: KubaZ2 Date: Sun, 24 Mar 2024 19:50:49 +0100 Subject: [PATCH 19/19] Fix new lines --- NetCord/Gateway/GuildJoinRequestFormResponse.cs | 2 +- .../EventArgs/JsonGuildJoinRequestDeleteEventArgs.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/NetCord/Gateway/GuildJoinRequestFormResponse.cs b/NetCord/Gateway/GuildJoinRequestFormResponse.cs index 6da263842..e23b149bf 100644 --- a/NetCord/Gateway/GuildJoinRequestFormResponse.cs +++ b/NetCord/Gateway/GuildJoinRequestFormResponse.cs @@ -3,7 +3,7 @@ public class GuildJoinRequestFormResponse(JsonModels.JsonGuildJoinRequestFormResponse jsonModel) : IJsonModel { JsonModels.JsonGuildJoinRequestFormResponse IJsonModel.JsonModel => jsonModel; - + public GuildJoinRequestFormResponseFieldType FieldType => jsonModel.FieldType; public string Label => jsonModel.Label; public bool Required => jsonModel.Required; diff --git a/NetCord/Gateway/JsonModels/EventArgs/JsonGuildJoinRequestDeleteEventArgs.cs b/NetCord/Gateway/JsonModels/EventArgs/JsonGuildJoinRequestDeleteEventArgs.cs index f91b8b5d3..1fc6724ca 100644 --- a/NetCord/Gateway/JsonModels/EventArgs/JsonGuildJoinRequestDeleteEventArgs.cs +++ b/NetCord/Gateway/JsonModels/EventArgs/JsonGuildJoinRequestDeleteEventArgs.cs @@ -6,10 +6,10 @@ public class JsonGuildJoinRequestDeleteEventArgs { [JsonPropertyName("id")] public ulong JoinRequestId { get; set; } - + [JsonPropertyName("user_id")] public ulong UserId { get; set; } - + [JsonPropertyName("guild_id")] public ulong GuildId { get; set; } }