Browse Source

Fix invalid parsing of the name field on `SocketInteractionDataOption`. Changed `Member` to `User` on SocketInteraction.

pull/1717/head
quin lynch 4 years ago
parent
commit
4f9b48c417
2 changed files with 5 additions and 5 deletions
  1. +4
    -4
      src/Discord.Net.WebSocket/Entities/Interaction/SocketInteraction.cs
  2. +1
    -1
      src/Discord.Net.WebSocket/Entities/Interaction/SocketInteractionDataOption.cs

+ 4
- 4
src/Discord.Net.WebSocket/Entities/Interaction/SocketInteraction.cs View File

@@ -28,8 +28,8 @@ namespace Discord.WebSocket
/// <summary> /// <summary>
/// The <see cref="SocketGuildUser"/> who triggered this interaction. /// The <see cref="SocketGuildUser"/> who triggered this interaction.
/// </summary> /// </summary>
public SocketGuildUser Member
=> Guild.GetUser(MemberId);
public SocketGuildUser User
=> Guild.GetUser(UserId);


/// <summary> /// <summary>
/// The type of this interaction. /// The type of this interaction.
@@ -61,7 +61,7 @@ namespace Discord.WebSocket


private ulong GuildId { get; set; } private ulong GuildId { get; set; }
private ulong ChannelId { get; set; } private ulong ChannelId { get; set; }
private ulong MemberId { get; set; }
private ulong UserId { get; set; }


internal SocketInteraction(DiscordSocketClient client, ulong id) internal SocketInteraction(DiscordSocketClient client, ulong id)
: base(client, id) : base(client, id)
@@ -85,7 +85,7 @@ namespace Discord.WebSocket
this.ChannelId = model.ChannelId; this.ChannelId = model.ChannelId;
this.Token = model.Token; this.Token = model.Token;
this.Version = model.Version; this.Version = model.Version;
this.MemberId = model.Member.User.Id;
this.UserId = model.Member.User.Id;
this.Type = model.Type; this.Type = model.Type;
} }
private bool CheckToken() private bool CheckToken()


+ 1
- 1
src/Discord.Net.WebSocket/Entities/Interaction/SocketInteractionDataOption.cs View File

@@ -30,7 +30,7 @@ namespace Discord.WebSocket
internal SocketInteractionDataOption() { } internal SocketInteractionDataOption() { }
internal SocketInteractionDataOption(Model model, DiscordSocketClient discord, ulong guild) 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.Value = model.Value.IsSpecified ? model.Value.Value : null;
this.discord = discord; this.discord = discord;
this.guild = guild; this.guild = guild;


Loading…
Cancel
Save