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>
/// The <see cref="SocketGuildUser"/> who triggered this interaction.
/// </summary>
public SocketGuildUser Member
=> Guild.GetUser(MemberId);
public SocketGuildUser User
=> Guild.GetUser(UserId);

/// <summary>
/// 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()


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

@@ -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;


Loading…
Cancel
Save