Ignore events if they target a user that was not downloaded yet

This commit is contained in:
RogueException
2016-07-25 05:52:03 -03:00
parent f81c2660c7
commit 0360f777dd

View File

@@ -892,6 +892,12 @@ namespace Discord
}
else
{
if (!guild.HasAllMembers)
{
await _gatewayLogger.DebugAsync("Ignored GUILD_MEMBER_UPDATE, this user has not been downloaded yet.").ConfigureAwait(false);
return;
}
await _gatewayLogger.WarningAsync("GUILD_MEMBER_UPDATE referenced an unknown user.").ConfigureAwait(false);
return;
}
@@ -926,6 +932,12 @@ namespace Discord
}
else
{
if (!guild.HasAllMembers)
{
await _gatewayLogger.DebugAsync("Ignored GUILD_MEMBER_REMOVE, this user has not been downloaded yet.").ConfigureAwait(false);
return;
}
await _gatewayLogger.WarningAsync("GUILD_MEMBER_REMOVE referenced an unknown user.").ConfigureAwait(false);
return;
}