diff --git a/src/Discord.Net.WebSocket/DiscordSocketConfig.cs b/src/Discord.Net.WebSocket/DiscordSocketConfig.cs index 3ac2a81a0..bc3a45710 100644 --- a/src/Discord.Net.WebSocket/DiscordSocketConfig.cs +++ b/src/Discord.Net.WebSocket/DiscordSocketConfig.cs @@ -7,6 +7,22 @@ namespace Discord.WebSocket /// /// Represents a configuration class for . /// + /// + /// This configuration, based on , helps determine several key configurations the + /// socket client depend on. For instance, shards and connection timeout. + /// + /// + /// The following config enables the message cache and configures the client to always download user upon guild + /// availability. + /// + /// var config = new DiscordSocketConfig + /// { + /// AlwaysDownloadUsers = true, + /// MessageCacheSize = 100 + /// }; + /// var client = new DiscordSocketClient(config); + /// + /// public class DiscordSocketConfig : DiscordRestConfig { /// @@ -57,6 +73,30 @@ namespace Discord.WebSocket /// /// Gets or sets whether or not all users should be downloaded as guilds come available. /// + /// + /// + /// By default, Discord gateway will only send offline members if a guild has less than a certain number + /// of members (determined by in this library). This behaviour is why + /// sometimes a user may be missing from the WebSocket cache for collections such as + /// . + /// + /// + /// This property ensures that whenever a guild becomes available (determined by + /// ), incomplete user chunks will be + /// downloaded to the WebSocket cache. + /// + /// + /// For more information, please see + /// Request Guild Members + /// on the official Discord API documentation. + /// + /// + /// Please note that it can be difficult to fill the cache completely on large guilds depending on the + /// traffic. If you are using the command system, the default user TypeReader may fail to find the user + /// due to this issue. This may be resolved at v3 of the library. Until then, you may want to consider + /// overriding the TypeReader and use as a backup. + /// + /// public bool AlwaysDownloadUsers { get; set; } = false; /// /// Gets or sets the timeout for event handlers, in milliseconds, after which a warning will be logged. Null