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

This commit is contained in:
Quin Lynch
2022-04-30 19:02:57 -03:00
committed by GitHub
parent 503e720d21
commit f2bb55e804

View File

@@ -2331,7 +2331,9 @@ namespace Discord.WebSocket
SocketUser user = data.User.IsSpecified SocketUser user = data.User.IsSpecified
? State.GetOrAddUser(data.User.Value.Id, (_) => SocketGlobalUser.Create(this, State, data.User.Value)) ? 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; SocketChannel channel = null;
if(data.ChannelId.IsSpecified) if(data.ChannelId.IsSpecified)