diff --git a/src/Discord.Net.Rest/API/Common/ApplicationCommandInteractionData.cs b/src/Discord.Net.Rest/API/Common/ApplicationCommandInteractionData.cs index b421edf6f..118dcc0f0 100644 --- a/src/Discord.Net.Rest/API/Common/ApplicationCommandInteractionData.cs +++ b/src/Discord.Net.Rest/API/Common/ApplicationCommandInteractionData.cs @@ -1,9 +1,5 @@ using Newtonsoft.Json; -using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Discord.API { @@ -16,6 +12,6 @@ namespace Discord.API public string Name { get; set; } [JsonProperty("options")] - public Optional Options { get; set; } + public List Options { get; set; } = new(); } } diff --git a/src/Discord.Net.Rest/API/Common/ApplicationCommandInteractionDataOption.cs b/src/Discord.Net.Rest/API/Common/ApplicationCommandInteractionDataOption.cs index 84f2e3f7a..33d04800f 100644 --- a/src/Discord.Net.Rest/API/Common/ApplicationCommandInteractionDataOption.cs +++ b/src/Discord.Net.Rest/API/Common/ApplicationCommandInteractionDataOption.cs @@ -1,9 +1,5 @@ using Newtonsoft.Json; -using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Discord.API { @@ -16,6 +12,6 @@ namespace Discord.API public Optional Value { get; set; } [JsonProperty("options")] - public Optional> Options { get; set; } + public List Options { get; set; } = new(); } } diff --git a/src/Discord.Net.Rest/DiscordRestApiClient.cs b/src/Discord.Net.Rest/DiscordRestApiClient.cs index da3410807..9f2e90730 100644 --- a/src/Discord.Net.Rest/DiscordRestApiClient.cs +++ b/src/Discord.Net.Rest/DiscordRestApiClient.cs @@ -956,7 +956,7 @@ namespace Discord.API options = RequestOptions.CreateOrClone(options); - return await SendAsync("GET", $"webhooks/{this.CurrentUserId}/{interactionToken}/messages/@original").ConfigureAwait(false); + return await SendAsync("GET", () => $"webhooks/{this.CurrentUserId}/{interactionToken}/messages/@original", new BucketIds(), options: options).ConfigureAwait(false); } public async Task ModifyInteractionResponse(ModifyInteractionResponseParams args, string interactionToken, RequestOptions options = null) { diff --git a/src/Discord.Net.WebSocket/Entities/Interaction/Slash Commands/SocketSlashCommand.cs b/src/Discord.Net.WebSocket/Entities/Interaction/Slash Commands/SocketSlashCommand.cs index 644b7c3fc..72e8a0d6a 100644 --- a/src/Discord.Net.WebSocket/Entities/Interaction/Slash Commands/SocketSlashCommand.cs +++ b/src/Discord.Net.WebSocket/Entities/Interaction/Slash Commands/SocketSlashCommand.cs @@ -1,12 +1,10 @@ using Discord.Rest; using Newtonsoft.Json.Linq; using System; -using System.Collections.Generic; using System.Linq; -using System.Text; using System.Threading.Tasks; -using Model = Discord.API.Gateway.InteractionCreated; using DataModel = Discord.API.ApplicationCommandInteractionData; +using Model = Discord.API.Gateway.InteractionCreated; namespace Discord.WebSocket { diff --git a/src/Discord.Net.WebSocket/Entities/Interaction/Slash Commands/SocketSlashCommandData.cs b/src/Discord.Net.WebSocket/Entities/Interaction/Slash Commands/SocketSlashCommandData.cs index 79a2cfd53..3ef6678e1 100644 --- a/src/Discord.Net.WebSocket/Entities/Interaction/Slash Commands/SocketSlashCommandData.cs +++ b/src/Discord.Net.WebSocket/Entities/Interaction/Slash Commands/SocketSlashCommandData.cs @@ -1,9 +1,6 @@ -using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Linq; -using System.Text; -using System.Threading.Tasks; using Model = Discord.API.ApplicationCommandInteractionData; namespace Discord.WebSocket @@ -14,7 +11,7 @@ namespace Discord.WebSocket public string Name { get; private set; } /// - /// The 's recieved with this interaction. + /// The 's received with this interaction. /// public IReadOnlyCollection Options { get; private set; } @@ -33,8 +30,9 @@ namespace Discord.WebSocket internal void Update(Model model) { this.Name = model.Name; - this.Options = model.Options.IsSpecified - ? model.Options.Value.Select(x => new SocketSlashCommandDataOption(x, this.Discord)).ToImmutableArray() + + this.Options = model.Options.Any() + ? model.Options.Select(x => new SocketSlashCommandDataOption(x, this.Discord)).ToImmutableArray() : null; } 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 691d8951c..e7ff1c5d5 100644 --- a/src/Discord.Net.WebSocket/Entities/Interaction/Slash Commands/SocketSlashCommandDataOption.cs +++ b/src/Discord.Net.WebSocket/Entities/Interaction/Slash Commands/SocketSlashCommandDataOption.cs @@ -1,9 +1,6 @@ -using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Linq; -using System.Text; -using System.Threading.Tasks; using Model = Discord.API.ApplicationCommandInteractionDataOption; namespace Discord.WebSocket @@ -20,7 +17,7 @@ namespace Discord.WebSocket public object Value { get; private set; } /// - /// The sub command options recieved for this sub command group. + /// The sub command options received for this sub command group. /// public IReadOnlyCollection Options { get; private set; } @@ -33,8 +30,8 @@ namespace Discord.WebSocket this.Value = model.Value.IsSpecified ? model.Value.Value : null; this.discord = discord; - this.Options = model.Options.IsSpecified - ? model.Options.Value.Select(x => new SocketSlashCommandDataOption(x, discord)).ToImmutableArray() + this.Options = model.Options.Any() + ? model.Options.Select(x => new SocketSlashCommandDataOption(x, discord)).ToImmutableArray() : null; }