Skip to content

Commit

Permalink
FIX] Update TypingStartedEvent model (#2702)
Browse files Browse the repository at this point in the history
  • Loading branch information
Misha-133 committed Jun 27, 2023
1 parent df717e6 commit 547bc92
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Discord.Net.WebSocket/API/Gateway/TypingStartEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ internal class TypingStartEvent
[JsonProperty("channel_id")]
public ulong ChannelId { get; set; }
[JsonProperty("guild_id")]
public ulong GuildId { get; set; }
public Optional<ulong> GuildId { get; set; }
[JsonProperty("member")]
public GuildMember Member { get; set; }
public Optional<GuildMember> Member { get; set; }
[JsonProperty("timestamp")]
public int Timestamp { get; set; }
}
Expand Down
4 changes: 2 additions & 2 deletions src/Discord.Net.WebSocket/DiscordSocketClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2046,8 +2046,8 @@ private async Task ProcessMessageAsync(GatewayOpCode opCode, int? seq, string ty
var user = (channel as SocketChannel)?.GetUser(data.UserId);
if (user == null)
{
if (guild != null)
user = guild.AddOrUpdateUser(data.Member);
if (guild != null && data.Member.IsSpecified)
user = guild.AddOrUpdateUser(data.Member.Value);
}
var cacheableUser = new Cacheable<IUser, ulong>(user, data.UserId, user != null, async () => await GetUserAsync(data.UserId).ConfigureAwait(false));

Expand Down

0 comments on commit 547bc92

Please sign in to comment.