Class KuracordConfiguration
Represents configuration for KuracordClient.
Inherited Members
Namespace: KSharpPlus
Assembly: KSharpPlus.dll
Syntax
public sealed class KuracordConfiguration
Constructors
| Improve this Doc View SourceKuracordConfiguration()
Creates a new configuration with default values.
Declaration
public KuracordConfiguration()
KuracordConfiguration(KuracordConfiguration)
Creates a clone of another kuracord configuration.
Declaration
public KuracordConfiguration(KuracordConfiguration other)
Parameters
Type | Name | Description |
---|---|---|
KuracordConfiguration | other | Client configuration to clone. |
Properties
| Improve this Doc View SourceAutoReconnect
Sets whether to automatically reconnect in case a connection is lost.
Defaults to true.
Declaration
public bool AutoReconnect { set; }
Property Value
Type | Description |
---|---|
Boolean |
HttpTimeout
Sets the timeout for HTTP requests.
Set to InfiniteTimeSpan to disable timeouts.
Defaults to 10 seconds.
Declaration
public TimeSpan HttpTimeout { set; }
Property Value
Type | Description |
---|---|
TimeSpan |
LoggerFactory
Sets the logger implementation to use.
To create your own logger, implement the
Defaults to built-in implementation.
Declaration
public ILoggerFactory LoggerFactory { set; }
Property Value
Type | Description |
---|---|
ILoggerFactory |
LogTimestampFormat
Allows you to overwrite the time format used by the internal debug logger.
Only applicable when LoggerFactory is set left at default value. Defaults to ISO 8601-like format.
Declaration
public string LogTimestampFormat { set; }
Property Value
Type | Description |
---|---|
String |
LogUnknownEvents
Whether to log unknown events or not. Defaults to true.
Declaration
public bool LogUnknownEvents { set; }
Property Value
Type | Description |
---|---|
Boolean |
MessageCacheSize
Sets the size of the global message cache.
Setting this to 0 will disable message caching entirely. Defaults to 1024.
Declaration
public int MessageCacheSize { set; }
Property Value
Type | Description |
---|---|
Int32 |
MinimumLogLevel
Sets the minimum logging level for messages.
Typically, the default value of Information is ok for most uses.
Declaration
public LogLevel MinimumLogLevel { set; }
Property Value
Type | Description |
---|---|
LogLevel |
Proxy
Sets the proxy to use for HTTP and WebSocket connections to Kuracord.
Defaults to null.
Declaration
public IWebProxy Proxy { set; }
Property Value
Type | Description |
---|---|
IWebProxy |
ReconnectIndefinitely
Defines that the client should attempt to reconnect indefinitely.
This is typically a very bad idea to set to true
, as it will swallow all connection errors.
Defaults to false.
Declaration
public bool ReconnectIndefinitely { set; }
Property Value
Type | Description |
---|---|
Boolean |
Token
Sets the token used to identify the client.
Declaration
public string Token { set; }
Property Value
Type | Description |
---|---|
String |
TokenType
Sets the type of the token used to identify the client.
Defaults to Bot.
Declaration
public TokenType TokenType { set; }
Property Value
Type | Description |
---|---|
TokenType |
UseRelativeRatelimit
Sets whether to rely on Kuracord for NTP (Network Time Protocol) synchronization with the "X-Ratelimit-Reset-After" header.
If the system clock is not synced, setting this to true will ensure ratelimits are synced with Kuracord and reduce the risk of hitting one.
This should only be set to false if the system clock is synced with NTP.
Defaults to true.
Declaration
public bool UseRelativeRatelimit { set; }
Property Value
Type | Description |
---|---|
Boolean |
WebSocketClientFactory
Sets the factory method used to create instances of WebSocket clients.
Use CreateNew(IWebProxy) and equivalents on other implementations to switch out client implementations.
Defaults to CreateNew(IWebProxy).
Declaration
public WebSocketClientFactoryDelegate WebSocketClientFactory { set; }
Property Value
Type | Description |
---|---|
WebSocketClientFactoryDelegate |