Made large_threshold mandatory
This commit is contained in:
@@ -17,7 +17,7 @@ namespace Discord.API.Client.GatewaySocket
|
||||
[JsonProperty("properties")]
|
||||
public Dictionary<string, string> Properties { get; set; }
|
||||
[JsonProperty("large_threshold", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public int? LargeThreshold { get; set; }
|
||||
public int LargeThreshold { get; set; }
|
||||
[JsonProperty("compress")]
|
||||
public bool UseCompression { get; set; }
|
||||
}
|
||||
|
||||
@@ -896,12 +896,7 @@ namespace Discord
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Config.UseLargeThreshold)
|
||||
user = server.AddUser(data.User.Id);
|
||||
else
|
||||
user = server.GetUser(data.User.Id);
|
||||
}
|
||||
user = server.AddUser(data.User.Id);
|
||||
}
|
||||
|
||||
if (user != null)
|
||||
|
||||
@@ -34,8 +34,6 @@ namespace Discord
|
||||
|
||||
/// <summary> Gets or sets whether an encrypted login token should be saved to temp dir after successful login. </summary>
|
||||
public bool CacheToken { get; set; } = true;
|
||||
/// <summary> Gets or sets whether Discord should send information about offline users, for servers with more than 100 users. </summary>
|
||||
public bool UseLargeThreshold { get; set; } = false;
|
||||
/// <summary> Gets or sets the number of messages per channel that should be kept in cache. Setting this to zero disables the message cache entirely. </summary>
|
||||
public int MessageCacheSize { get; set; } = 100;
|
||||
/// <summary> Gets or sets whether the permissions cache should be used. This makes operations such as User.GetPermissions(Channel), User.ServerPermissions and Channel.Members </summary>
|
||||
@@ -74,7 +72,7 @@ namespace Discord
|
||||
public int ReconnectDelay { get; }
|
||||
public int FailedReconnectDelay { get; }
|
||||
|
||||
public bool UseLargeThreshold { get; }
|
||||
public int LargeThreshold { get; } = 250;
|
||||
public int MessageCacheSize { get; }
|
||||
public bool UsePermissionsCache { get; }
|
||||
public bool EnablePreUpdateEvents { get; }
|
||||
@@ -90,8 +88,7 @@ namespace Discord
|
||||
ConnectionTimeout = builder.ConnectionTimeout;
|
||||
ReconnectDelay = builder.ReconnectDelay;
|
||||
FailedReconnectDelay = builder.FailedReconnectDelay;
|
||||
|
||||
UseLargeThreshold = builder.UseLargeThreshold;
|
||||
|
||||
MessageCacheSize = builder.MessageCacheSize;
|
||||
UsePermissionsCache = builder.UsePermissionsCache;
|
||||
EnablePreUpdateEvents = builder.EnablePreUpdateEvents;
|
||||
|
||||
@@ -161,7 +161,7 @@ namespace Discord.Net.WebSockets
|
||||
Version = 3,
|
||||
Token = token,
|
||||
Properties = props,
|
||||
LargeThreshold = _config.UseLargeThreshold ? 100 : (int?)null,
|
||||
LargeThreshold = _config.LargeThreshold,
|
||||
UseCompression = true
|
||||
};
|
||||
QueueMessage(msg);
|
||||
|
||||
Reference in New Issue
Block a user