Browse Source

fix: null user on interaction without bot scope (#2271)

tags/3.6.1
Quin Lynch GitHub 3 years ago
parent
commit
f2bb55e804
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      src/Discord.Net.WebSocket/DiscordSocketClient.cs

+ 3
- 1
src/Discord.Net.WebSocket/DiscordSocketClient.cs View File

@@ -2331,7 +2331,9 @@ namespace Discord.WebSocket

SocketUser user = data.User.IsSpecified
? State.GetOrAddUser(data.User.Value.Id, (_) => SocketGlobalUser.Create(this, State, data.User.Value))
: guild?.AddOrUpdateUser(data.Member.Value); // null if the bot scope isn't set, so the guild cannot be retrieved.
: guild != null
? guild.AddOrUpdateUser(data.Member.Value) // null if the bot scope isn't set, so the guild cannot be retrieved.
: State.GetOrAddUser(data.Member.Value.User.Id, (_) => SocketGlobalUser.Create(this, State, data.Member.Value.User));

SocketChannel channel = null;
if(data.ChannelId.IsSpecified)


Loading…
Cancel
Save