Table of Contents

Class DiscordConfig

Namespace
Discord
Assembly
Discord.Net.Core.dll

Defines various behaviors of Discord.Net.

public class DiscordConfig
Inheritance
DiscordConfig
Derived
Inherited Members

Fields

APIUrl

Returns the base Discord API URL.

public static readonly string APIUrl

Field Value

string

The Discord API URL using APIVersion.

APIVersion

Returns the API version Discord.Net uses.

public const int APIVersion = 10

Field Value

int

An int representing the API version that Discord.Net uses to communicate with Discord.

A list of available API version can be seen on the official Discord API documentation .

CDNUrl

Returns the base Discord CDN URL.

public const string CDNUrl = "https://cdn.discordapp.com/"

Field Value

string

The base Discord Content Delivery Network (CDN) URL.

DefaultRequestTimeout

Returns the default timeout for requests.

public const int DefaultRequestTimeout = 15000

Field Value

int

The amount of time it takes in milliseconds before a request is timed out.

InviteUrl

Returns the base Discord invite URL.

public const string InviteUrl = "https://discord.gg/"

Field Value

string

The base Discord invite URL.

MaxApplicationDescriptionLength

Returns the max length of an application description.

public const int MaxApplicationDescriptionLength = 400

Field Value

int

MaxApplicationTagCount

Returns the max amount of tags applied to an application.

public const int MaxApplicationTagCount = 5

Field Value

int

MaxApplicationTagLength

Returns the max length of an application tag.

public const int MaxApplicationTagLength = 20

Field Value

int

MaxAuditLogEntriesPerBatch

Returns the max audit log entries allowed to be in a request.

public const int MaxAuditLogEntriesPerBatch = 100

Field Value

int

The maximum number of audit log entries that can be gotten per-batch.

MaxBansPerBatch

Returns the max bans allowed to be in a request.

public const int MaxBansPerBatch = 1000

Field Value

int

The maximum number of bans that can be gotten per-batch.

MaxBansPerBulkBatch

Returns the maximum number of bans that can be banned in a single bulk request.

public const int MaxBansPerBulkBatch = 200

Field Value

int

MaxEmbedsPerMessage

Returns the max number of embeds that can be sent with a message.

public const int MaxEmbedsPerMessage = 10

Field Value

int

MaxEntitlementsPerBatch

Returns the maximum number of entitlements that can be gotten per-batch.

public const int MaxEntitlementsPerBatch = 100

Field Value

int

MaxGuildEventUsersPerBatch

Returns the max users allowed to be in a request for guild event users.

public const int MaxGuildEventUsersPerBatch = 100

Field Value

int

The maximum number of users that can be gotten per-batch.

MaxGuildsPerBatch

Returns the max guilds allowed to be in a request.

public const int MaxGuildsPerBatch = 100

Field Value

int

The maximum number of guilds that can be gotten per-batch.

MaxMessageSize

Returns the max length for a Discord message.

public const int MaxMessageSize = 2000

Field Value

int

The maximum length of a message allowed by Discord.

MaxMessagesPerBatch

Returns the max messages allowed to be in a request.

public const int MaxMessagesPerBatch = 100

Field Value

int

The maximum number of messages that can be gotten per-batch.

MaxPollAnswerTextLength

Returns the maximum length of a poll answer text.

public const int MaxPollAnswerTextLength = 55

Field Value

int

MaxPollQuestionTextLength

Returns the maximum length of a poll question text.

public const int MaxPollQuestionTextLength = 300

Field Value

int

MaxPollVotersPerBatch

Returns the maximum number of poll answer voters that can be gotten per-batch.

public const int MaxPollVotersPerBatch = 100

Field Value

int

MaxStickersPerMessage

Returns the max number of stickers that can be sent with a message.

public const int MaxStickersPerMessage = 3

Field Value

int

MaxSubscriptionsPerBatch

Returns the maximum number of subscriptions that can be gotten per-batch.

public const int MaxSubscriptionsPerBatch = 100

Field Value

int

MaxThreadMembersPerBatch

Returns the max thread members allowed to be in a request.

public const int MaxThreadMembersPerBatch = 100

Field Value

int

The maximum number of thread members that can be gotten per-batch.

MaxUserReactionsPerBatch

Returns the max user reactions allowed to be in a request.

public const int MaxUserReactionsPerBatch = 100

Field Value

int

The maximum number of user reactions that can be gotten per-batch.

MaxUsersPerBatch

Returns the max users allowed to be in a request.

public const int MaxUsersPerBatch = 1000

Field Value

int

The maximum number of users that can be gotten per-batch.

MaxVoiceChannelStatusLength

Returns the maximum length of a voice channel status.

public const int MaxVoiceChannelStatusLength = 500

Field Value

int

VoiceAPIVersion

Returns the Voice API version Discord.Net uses.

public const int VoiceAPIVersion = 3

Field Value

int

An int representing the API version that Discord.Net uses to communicate with Discord's voice server.

Properties

DefaultRatelimitCallback

Gets or sets the default callback for ratelimits.

public Func<IRateLimitInfo, Task> DefaultRatelimitCallback { get; set; }

Property Value

Func<IRateLimitInfo, Task>

Remarks

This property is mutually exclusive with RatelimitCallback.

DefaultRetryMode

Gets or sets how a request should act in the case of an error, by default.

public RetryMode DefaultRetryMode { get; set; }

Property Value

RetryMode

The currently set RetryMode.

FormatUsersInBidirectionalUnicode

Gets or sets if the Rest/Socket user ToString() override formats the string in respect to bidirectional unicode.

public bool FormatUsersInBidirectionalUnicode { get; set; }

Property Value

bool

Remarks

By default, the returned value will be "?Discord?#1234", to work with bidirectional usernames.
If set to false, this value will be "Discord#1234".

LogLevel

Gets or sets the minimum log level severity that will be sent to the Log event.

public LogSeverity LogLevel { get; set; }

Property Value

LogSeverity

The currently set LogSeverity for logging level.

ResponseInternalTimeCheck

Gets or sets whether or not any responses to Discord will make an internal expiration check.

public bool ResponseInternalTimeCheck { get; set; }

Property Value

bool

Remarks

This should generally be set to false in a development environment due to potential latency issues.

UseInteractionSnowflakeDate

Gets or sets whether or not the internal expiration check uses the system date

  • snowflake date to check if an interaction can be responded to.
public bool UseInteractionSnowflakeDate { get; set; }

Property Value

bool

Remarks

If set to false then the CreatedAt property in an interaction will be set to when it was received instead of the snowflakes date.
This will still require a stable clock on your system.

UseSystemClock

Gets or sets whether or not rate-limits should use the system clock.

public bool UseSystemClock { get; set; }

Property Value

bool

Remarks

If set to false, we will use the X-RateLimit-Reset-After header to determine when a rate-limit expires, rather than comparing the X-RateLimit-Reset timestamp to the system time.

This should only be changed to false if the system is known to have a clock that is out of sync. Relying on the Reset-After header will incur network lag.

Regardless of this property, we still rely on the system's wall-clock to determine if a bucket is rate-limited; we do not use any monotonic clock. Your system will still need a stable clock.

UserAgent

Gets the user agent that Discord.Net uses in its clients.

public static string UserAgent { get; }

Property Value

string

The user agent used in each Discord.Net request.

Version

Gets the Discord.Net version, including the build number.

public static string Version { get; }

Property Value

string

A string containing the detailed version information, including its build number; Unknown when the version fails to be fetched.