Fixed GUILD_MEMBER_REMOVE

This commit is contained in:
RogueException
2015-12-11 21:30:53 -04:00
parent 52934bf390
commit ca56063e14
3 changed files with 6 additions and 6 deletions

View File

@@ -14,14 +14,15 @@ namespace Discord.API
{ {
[JsonProperty("user_id")] [JsonProperty("user_id")]
[JsonConverter(typeof(LongStringConverter))] [JsonConverter(typeof(LongStringConverter))]
public long UserId; public long UserId; //Used in bans
[JsonProperty("guild_id")] [JsonProperty("guild_id")]
[JsonConverter(typeof(LongStringConverter))] [JsonConverter(typeof(LongStringConverter))]
public long GuildId; public long GuildId;
[JsonProperty("user")]
private UserReference _user; private UserReference _user;
public UserReference User [JsonProperty("user")]
public UserReference User
{ {
get { return _user; } get { return _user; }
set set

View File

@@ -512,7 +512,7 @@ namespace Discord
case "GUILD_MEMBER_REMOVE": case "GUILD_MEMBER_REMOVE":
{ {
var data = e.Payload.ToObject<MemberRemoveEvent>(_webSocket.Serializer); var data = e.Payload.ToObject<MemberRemoveEvent>(_webSocket.Serializer);
var user = _users.TryRemove(data.UserId, data.GuildId); var user = _users.TryRemove(data.User.Id, data.GuildId);
if (user != null) if (user != null)
RaiseUserLeft(user); RaiseUserLeft(user);
} }

View File

@@ -98,7 +98,6 @@ namespace Discord
public int WebSocketInterval { get { return _webSocketInterval; } set { SetValue(ref _webSocketInterval, value); } } public int WebSocketInterval { get { return _webSocketInterval; } set { SetValue(ref _webSocketInterval, value); } }
private int _webSocketInterval = 100; private int _webSocketInterval = 100;
//Performance //Performance
/// <summary> Instructs Discord to not send send information about offline users, for servers with more than 50 users. </summary> /// <summary> Instructs Discord to not send send information about offline users, for servers with more than 50 users. </summary>