using Discord.Net.Rest; using Discord.Net.WebSockets; using System.Reflection; namespace Discord { public class DiscordConfig { public const int MaxMessageSize = 2000; public const int MaxMessagesPerBatch = 100; public const string LibName = "Discord.Net"; public static string LibVersion => typeof(DiscordConfig).GetTypeInfo().Assembly?.GetName().Version.ToString(3) ?? "Unknown"; public const string LibUrl = "https://github.com/RogueException/Discord.Net"; public const string ClientAPIUrl = "https://discordapp.com/api/"; public const string CDNUrl = "https://cdn.discordapp.com/"; public const string InviteUrl = "https://discord.gg/"; /// Gets or sets name of your application, used in the user agent. public string AppName { get; set; } = null; /// Gets or sets url to your application, used in the user agent. public string AppUrl { get; set; } = null; /// Gets or sets the version of your application, used in the user agent. public string AppVersion { get; set; } = null; /// Gets or sets the minimum log level severity that will be sent to the LogMessage event. public LogSeverity LogLevel { get; set; } = LogSeverity.Info; /// Gets or sets the time (in milliseconds) to wait for the websocket to connect and initialize. public int ConnectionTimeout { get; set; } = 30000; /// Gets or sets the time (in milliseconds) to wait after an unexpected disconnect before reconnecting. public int ReconnectDelay { get; set; } = 1000; /// Gets or sets the time (in milliseconds) to wait after an reconnect fails before retrying. public int FailedReconnectDelay { get; set; } = 15000; //Performance /// Gets or sets the number of messages per channel that should be kept in cache. Setting this to zero disables the message cache entirely. public int MessageCacheSize { get; set; } = 100; /// /// Gets or sets whether the permissions cache should be used. /// This makes operations such as User.GetPermissions(Channel), User.ServerPermissions, Channel.GetUser, and Channel.Members much faster while increasing memory usage. /// public bool UsePermissionsCache { get; set; } = true; /// Gets or sets whether the a copy of a model is generated on an update event to allow you to check which properties changed. public bool EnablePreUpdateEvents { get; set; } = true; /// /// Gets or sets the max number of users a server may have for offline users to be included in the READY packet. Max is 250. /// Decreasing this may reduce CPU usage while increasing login time and network usage. /// public int LargeThreshold { get; set; } = 250; //Engines /// Gets or sets the REST engine to use.. Defaults to DefaultRestClientProvider, which uses .Net's HttpClient class. public IRestClientProvider RestClientProvider { get; set; } = null; /// /// Gets or sets the WebSocket engine to use. Defaults to DefaultWebSocketProvider, which uses .Net's WebSocketClient class. /// WebSockets are only used if DiscordClient.Connect() is called. /// public IWebSocketProvider WebSocketProvider { get; set; } = null; } }