using System.Reflection;
namespace Discord
{
///
/// Defines various behaviors of Discord.Net.
///
public class DiscordConfig
{
///
/// Returns the API version Discord.Net uses.
///
///
/// An 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
/// .
///
public const int APIVersion = 6;
///
/// Returns the Voice API version Discord.Net uses.
///
///
/// An representing the API version that Discord.Net uses to communicate with Discord's
/// voice server.
///
public const int VoiceAPIVersion = 3;
///
/// Gets the Discord.Net version, including the build number.
///
///
/// A string containing the detailed version information, including its build number; Unknown when
/// the version fails to be fetched.
///
public static string Version { get; } =
typeof(DiscordConfig).GetTypeInfo().Assembly.GetCustomAttribute()?.InformationalVersion ??
typeof(DiscordConfig).GetTypeInfo().Assembly.GetName().Version.ToString(3) ??
"Unknown";
///
/// Gets the user agent that Discord.Net uses in its clients.
///
///
/// The user agent used in each Discord.Net request.
///
public static string UserAgent { get; } = $"DiscordBot (https://github.com/RogueException/Discord.Net, v{Version})";
///
/// Returns the base Discord API URL.
///
///
/// The Discord API URL using .
///
public static readonly string APIUrl = $"https://discord.com/api/v{APIVersion}/";
///
/// Returns the base Discord CDN URL.
///
///
/// The base Discord Content Delivery Network (CDN) URL.
///
public const string CDNUrl = "https://cdn.discordapp.com/";
///
/// Returns the base Discord invite URL.
///
///
/// The base Discord invite URL.
///
public const string InviteUrl = "https://discord.gg/";
///
/// Returns the default timeout for requests.
///
///
/// The amount of time it takes in milliseconds before a request is timed out.
///
public const int DefaultRequestTimeout = 15000;
///
/// Returns the max length for a Discord message.
///
///
/// The maximum length of a message allowed by Discord.
///
public const int MaxMessageSize = 2000;
///
/// Returns the max messages allowed to be in a request.
///
///
/// The maximum number of messages that can be gotten per-batch.
///
public const int MaxMessagesPerBatch = 100;
///
/// Returns the max users allowed to be in a request.
///
///
/// The maximum number of users that can be gotten per-batch.
///
public const int MaxUsersPerBatch = 1000;
///
/// Returns the max guilds allowed to be in a request.
///
///
/// The maximum number of guilds that can be gotten per-batch.
///
public const int MaxGuildsPerBatch = 100;
///
/// Returns the max user reactions allowed to be in a request.
///
///
/// The maximum number of user reactions that can be gotten per-batch.
///
public const int MaxUserReactionsPerBatch = 100;
///
/// Returns the max audit log entries allowed to be in a request.
///
///
/// The maximum number of audit log entries that can be gotten per-batch.
///
public const int MaxAuditLogEntriesPerBatch = 100;
///
/// Gets or sets how a request should act in the case of an error, by default.
///
///
/// The currently set .
///
public RetryMode DefaultRetryMode { get; set; } = RetryMode.AlwaysRetry;
///
/// Gets or sets the minimum log level severity that will be sent to the Log event.
///
///
/// The currently set for logging level.
///
public LogSeverity LogLevel { get; set; } = LogSeverity.Info;
///
/// Gets or sets whether the initial log entry should be printed.
///
///
/// If set to true, the library will attempt to print the current version of the library, as well as
/// the API version it uses on startup.
///
internal bool DisplayInitialLog { get; set; } = true;
///
/// Gets or sets the level of precision of the rate limit reset response.
///
///
/// If set to , this value will be rounded up to the
/// nearest second.
///
///
/// The currently set .
///
public RateLimitPrecision RateLimitPrecision { get; set; } = RateLimitPrecision.Millisecond;
///
/// Gets or sets whether or not rate-limits should use the system clock.
///
///
/// 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.
///
public bool UseSystemClock { get; set; } = true;
}
}