From 4f9b48c417c6016adb1c8b0a6638e8e7d00c3c8a Mon Sep 17 00:00:00 2001 From: quin lynch Date: Mon, 5 Apr 2021 02:39:16 -0300 Subject: [PATCH] Fix invalid parsing of the name field on `SocketInteractionDataOption`. Changed `Member` to `User` on SocketInteraction. --- .../Entities/Interaction/SocketInteraction.cs | 8 ++++---- .../Entities/Interaction/SocketInteractionDataOption.cs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Discord.Net.WebSocket/Entities/Interaction/SocketInteraction.cs b/src/Discord.Net.WebSocket/Entities/Interaction/SocketInteraction.cs index 4a8277fd4..eebb590fe 100644 --- a/src/Discord.Net.WebSocket/Entities/Interaction/SocketInteraction.cs +++ b/src/Discord.Net.WebSocket/Entities/Interaction/SocketInteraction.cs @@ -28,8 +28,8 @@ namespace Discord.WebSocket /// /// The who triggered this interaction. /// - public SocketGuildUser Member - => Guild.GetUser(MemberId); + public SocketGuildUser User + => Guild.GetUser(UserId); /// /// The type of this interaction. @@ -61,7 +61,7 @@ namespace Discord.WebSocket private ulong GuildId { get; set; } private ulong ChannelId { get; set; } - private ulong MemberId { get; set; } + private ulong UserId { get; set; } internal SocketInteraction(DiscordSocketClient client, ulong id) : base(client, id) @@ -85,7 +85,7 @@ namespace Discord.WebSocket this.ChannelId = model.ChannelId; this.Token = model.Token; this.Version = model.Version; - this.MemberId = model.Member.User.Id; + this.UserId = model.Member.User.Id; this.Type = model.Type; } private bool CheckToken() diff --git a/src/Discord.Net.WebSocket/Entities/Interaction/SocketInteractionDataOption.cs b/src/Discord.Net.WebSocket/Entities/Interaction/SocketInteractionDataOption.cs index 62097689d..c4908bc4d 100644 --- a/src/Discord.Net.WebSocket/Entities/Interaction/SocketInteractionDataOption.cs +++ b/src/Discord.Net.WebSocket/Entities/Interaction/SocketInteractionDataOption.cs @@ -30,7 +30,7 @@ namespace Discord.WebSocket internal SocketInteractionDataOption() { } internal SocketInteractionDataOption(Model model, DiscordSocketClient discord, ulong guild) { - this.Name = Name; + this.Name = model.Name; this.Value = model.Value.IsSpecified ? model.Value.Value : null; this.discord = discord; this.guild = guild;