Skip to main content

Class DiscordSocketConfig

Represents a configuration class for Discord.WebSocket.DiscordSocketClient.

Assembly: Discord.Net.WebSocket.dll​
View Source​
Declaration
public class DiscordSocketConfig : DiscordRestConfig

Properties​

GatewayHost​

Gets or sets the WebSocket host to connect to. If null, the client will use the /gateway endpoint.

View Source​
Declaration
public string GatewayHost { get; set; }

ConnectionTimeout​

Gets or sets the time, in milliseconds, to wait for a connection to complete before aborting.

View Source​
Declaration
public int ConnectionTimeout { get; set; }

ShardId​

Gets or sets the ID for this shard. Must be less than Discord.WebSocket.DiscordSocketConfig.TotalShards.

View Source​
Declaration
public int? ShardId { get; set; }

TotalShards​

Gets or sets the total number of shards for this application.

View Source​
Declaration
public int? TotalShards { get; set; }

AlwaysDownloadDefaultStickers​

Gets or sets whether or not the client should download the default stickers on startup.

View Source​
Declaration
public bool AlwaysDownloadDefaultStickers { get; set; }

AlwaysResolveStickers​

Gets or sets whether or not the client should automatically resolve the stickers sent on a message.

View Source​
Declaration
public bool AlwaysResolveStickers { get; set; }

MessageCacheSize​

Gets or sets the number of messages per channel that should be kept in cache. Setting this to zero disables the message cache entirely.

View Source​
Declaration
public int MessageCacheSize { get; set; }

LargeThreshold​

Gets or sets the max number of users a guild may have for offline users to be included in the READY packet. The maximum value allowed is 250.

View Source​
Declaration
public int LargeThreshold { get; set; }

WebSocketProvider​

Gets or sets the provider used to generate new WebSocket connections.

View Source​
Declaration
public WebSocketProvider WebSocketProvider { get; set; }

UdpSocketProvider​

Gets or sets the provider used to generate new UDP sockets.

View Source​
Declaration
public UdpSocketProvider UdpSocketProvider { get; set; }

AlwaysDownloadUsers​

Gets or sets whether or not all users should be downloaded as guilds come available.

View Source​
Declaration
public bool AlwaysDownloadUsers { get; set; }

HandlerTimeout​

Gets or sets the timeout for event handlers, in milliseconds, after which a warning will be logged. Setting this property to nulldisables this check.

View Source​
Declaration
public int? HandlerTimeout { get; set; }

IdentifyMaxConcurrency​

Gets or sets the maximum identify concurrency.

View Source​
Declaration
public int IdentifyMaxConcurrency { get; set; }

MaxWaitBetweenGuildAvailablesBeforeReady​

Gets or sets the maximum wait time in milliseconds between GUILD_AVAILABLE events before firing READY. If zero, READY will fire as soon as it is received and all guilds will be unavailable.

View Source​
Declaration
public int MaxWaitBetweenGuildAvailablesBeforeReady { get; set; }

GatewayIntents​

Gets or sets gateway intents to limit what events are sent from Discord. The default is Discord.GatewayIntents.AllUnprivileged.

View Source​
Declaration
public GatewayIntents GatewayIntents { get; set; }

LogGatewayIntentWarnings​

Gets or sets whether or not to log warnings related to guild intents and events.

View Source​
Declaration
public bool LogGatewayIntentWarnings { get; set; }

Fields​

GatewayEncoding​

Returns the encoding gateway should use.

View Source​
Declaration
public const string GatewayEncoding = "json"