From 99a2204c434b701167fa3fe37b7cdd9dd605fc45 Mon Sep 17 00:00:00 2001 From: quin lynch Date: Mon, 5 Jul 2021 10:26:09 -0300 Subject: [PATCH] Update optionals in models regarding slash commands --- .../API/Common/ApplicationCommandInteractionData.cs | 2 +- .../API/Common/ApplicationCommandInteractionDataOption.cs | 2 +- src/Discord.Net.WebSocket/Discord.Net.WebSocket.csproj | 2 +- src/Discord.Net.WebSocket/Discord.Net.WebSocket.xml | 2 +- .../Slash Commands/SocketSlashCommandDataOption.cs | 4 ++-- src/Discord.Net/Discord.Net.nuspec | 8 ++++---- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Discord.Net.Rest/API/Common/ApplicationCommandInteractionData.cs b/src/Discord.Net.Rest/API/Common/ApplicationCommandInteractionData.cs index 314a6fd75..c0ced154a 100644 --- a/src/Discord.Net.Rest/API/Common/ApplicationCommandInteractionData.cs +++ b/src/Discord.Net.Rest/API/Common/ApplicationCommandInteractionData.cs @@ -12,7 +12,7 @@ namespace Discord.API public string Name { get; set; } [JsonProperty("options")] - public Optional> Options { get; set; } + public Optional Options { get; set; } [JsonProperty("resolved")] public Optional Resolved { get; set; } diff --git a/src/Discord.Net.Rest/API/Common/ApplicationCommandInteractionDataOption.cs b/src/Discord.Net.Rest/API/Common/ApplicationCommandInteractionDataOption.cs index 0eea07b83..5f75c901f 100644 --- a/src/Discord.Net.Rest/API/Common/ApplicationCommandInteractionDataOption.cs +++ b/src/Discord.Net.Rest/API/Common/ApplicationCommandInteractionDataOption.cs @@ -15,6 +15,6 @@ namespace Discord.API public Optional Value { get; set; } [JsonProperty("options")] - public List Options { get; set; } = new(); + public Optional Options { get; set; } } } diff --git a/src/Discord.Net.WebSocket/Discord.Net.WebSocket.csproj b/src/Discord.Net.WebSocket/Discord.Net.WebSocket.csproj index ed1c57540..8b0561d18 100644 --- a/src/Discord.Net.WebSocket/Discord.Net.WebSocket.csproj +++ b/src/Discord.Net.WebSocket/Discord.Net.WebSocket.csproj @@ -8,7 +8,7 @@ net461;netstandard2.0;netstandard2.1 netstandard2.0;netstandard2.1 true - 2.4.1 + 2.4.2 https://github.com/Discord-Net-Labs/Discord.Net-Labs https://github.com/Discord-Net-Labs/Discord.Net-Labs Temporary.png diff --git a/src/Discord.Net.WebSocket/Discord.Net.WebSocket.xml b/src/Discord.Net.WebSocket/Discord.Net.WebSocket.xml index 678d3331f..c382c7e27 100644 --- a/src/Discord.Net.WebSocket/Discord.Net.WebSocket.xml +++ b/src/Discord.Net.WebSocket/Discord.Net.WebSocket.xml @@ -1250,7 +1250,7 @@ With this option set to , you will have to acknowledge the interaction with . - Only after the interaction is acknowledged, the origional slash command message will be visible. + Only after the interaction is acknowledged, the original slash command message will be visible. Please note that manually acknowledging the interaction with a message reply will not provide any return data. diff --git a/src/Discord.Net.WebSocket/Entities/Interaction/Slash Commands/SocketSlashCommandDataOption.cs b/src/Discord.Net.WebSocket/Entities/Interaction/Slash Commands/SocketSlashCommandDataOption.cs index f611f773d..385ddf945 100644 --- a/src/Discord.Net.WebSocket/Entities/Interaction/Slash Commands/SocketSlashCommandDataOption.cs +++ b/src/Discord.Net.WebSocket/Entities/Interaction/Slash Commands/SocketSlashCommandDataOption.cs @@ -60,8 +60,8 @@ namespace Discord.WebSocket this.Value = model.Value.Value; } - this.Options = model.Options.Any() - ? model.Options.Select(x => new SocketSlashCommandDataOption(data, x)).ToImmutableArray() + this.Options = model.Options.IsSpecified + ? model.Options.Value.Select(x => new SocketSlashCommandDataOption(data, x)).ToImmutableArray() : null; } diff --git a/src/Discord.Net/Discord.Net.nuspec b/src/Discord.Net/Discord.Net.nuspec index 525ec615f..532f681ed 100644 --- a/src/Discord.Net/Discord.Net.nuspec +++ b/src/Discord.Net/Discord.Net.nuspec @@ -2,7 +2,7 @@ Discord.Net.Labs - 2.4.1$suffix$ + 2.4.2$suffix$ Discord.Net Labs Discord.Net Contributors quinchs @@ -16,21 +16,21 @@ - + - + - +