| @@ -1,10 +1,15 @@ | |||||
| namespace Discord | namespace Discord | ||||
| { | { | ||||
| /// <summary> Connection state for clients </summary> | |||||
| public enum ConnectionState : byte | public enum ConnectionState : byte | ||||
| { | { | ||||
| /// <summary> Not connected to Discord </summary> | |||||
| Disconnected, | Disconnected, | ||||
| /// <summary> Currently connecting to Discord </summary> | |||||
| Connecting, | Connecting, | ||||
| /// <summary> Connected to Discord </summary> | |||||
| Connected, | Connected, | ||||
| /// <summary> Disconnecting from Discord </summary> | |||||
| Disconnecting | Disconnecting | ||||
| } | } | ||||
| } | } | ||||
| @@ -2,20 +2,29 @@ | |||||
| namespace Discord | namespace Discord | ||||
| { | { | ||||
| /// <summary> Stores common configuration settings </summary> | |||||
| public class DiscordConfig | public class DiscordConfig | ||||
| { | { | ||||
| public const int APIVersion = 6; | |||||
| /// <summary> The version of Discord's REST API which is used </summary> | |||||
| public const int APIVersion = 6; | |||||
| /// <summary> Version information about Discord.Net </summary> | |||||
| public static string Version { get; } = | public static string Version { get; } = | ||||
| typeof(DiscordConfig).GetTypeInfo().Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion ?? | typeof(DiscordConfig).GetTypeInfo().Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion ?? | ||||
| typeof(DiscordConfig).GetTypeInfo().Assembly.GetName().Version.ToString(3) ?? | typeof(DiscordConfig).GetTypeInfo().Assembly.GetName().Version.ToString(3) ?? | ||||
| "Unknown"; | "Unknown"; | ||||
| /// <summary> The base URL for all REST API requests </summary> | |||||
| public static readonly string ClientAPIUrl = $"https://discordapp.com/api/v{APIVersion}/"; | public static readonly string ClientAPIUrl = $"https://discordapp.com/api/v{APIVersion}/"; | ||||
| /// <summary> The base URL for all CDN requests </summary> | |||||
| public const string CDNUrl = "https://discordcdn.com/"; | public const string CDNUrl = "https://discordcdn.com/"; | ||||
| /// <summary> The base URL for all invite links </summary> | |||||
| public const string InviteUrl = "https://discord.gg/"; | public const string InviteUrl = "https://discord.gg/"; | ||||
| /// <summary> The maximum amount of characters which can be sent in a message </summary> | |||||
| public const int MaxMessageSize = 2000; | public const int MaxMessageSize = 2000; | ||||
| /// <summary> The maximum number of messages which can be received in a batch </summary> | |||||
| public const int MaxMessagesPerBatch = 100; | public const int MaxMessagesPerBatch = 100; | ||||
| /// <summary> The maximum number of users which can be received in a batch </summary> | |||||
| public const int MaxUsersPerBatch = 1000; | public const int MaxUsersPerBatch = 1000; | ||||
| /// <summary> Gets or sets the minimum log level severity that will be sent to the LogMessage event. </summary> | /// <summary> Gets or sets the minimum log level severity that will be sent to the LogMessage event. </summary> | ||||
| @@ -1,5 +1,6 @@ | |||||
| namespace Discord | namespace Discord | ||||
| { | { | ||||
| /// <summary> Contains common macros for formatting text using Markdown </summary> | |||||
| public static class Format | public static class Format | ||||
| { | { | ||||
| /// <summary> Returns a markdown-formatted string with bold formatting. </summary> | /// <summary> Returns a markdown-formatted string with bold formatting. </summary> | ||||
| @@ -1,12 +1,19 @@ | |||||
| namespace Discord | namespace Discord | ||||
| { | { | ||||
| /// <summary> The severity of a log message </summary> | |||||
| public enum LogSeverity | public enum LogSeverity | ||||
| { | { | ||||
| /// <summary> Used when a critical, non-recoverable error occurs </summary> | |||||
| Critical = 0, | Critical = 0, | ||||
| /// <summary> Used when a recoverable error occurs </summary> | |||||
| Error = 1, | Error = 1, | ||||
| /// <summary> Used when a warning occurs </summary> | |||||
| Warning = 2, | Warning = 2, | ||||
| /// <summary> Used for general, informative messages </summary> | |||||
| Info = 3, | Info = 3, | ||||
| /// <summary> Used for debugging purposes </summary> | |||||
| Verbose = 4, | Verbose = 4, | ||||
| /// <summary> Used for debugging purposes </summary> | |||||
| Debug = 5 | Debug = 5 | ||||
| } | } | ||||
| } | } | ||||
| @@ -1,10 +1,15 @@ | |||||
| namespace Discord | namespace Discord | ||||
| { | { | ||||
| /// <summary> Login state for clients </summary> | |||||
| public enum LoginState : byte | public enum LoginState : byte | ||||
| { | { | ||||
| /// <summary> Logged out </summary> | |||||
| LoggedOut, | LoggedOut, | ||||
| /// <summary> Logging in </summary> | |||||
| LoggingIn, | LoggingIn, | ||||
| /// <summary> Logged in </summary> | |||||
| LoggedIn, | LoggedIn, | ||||
| /// <summary> Logging out </summary> | |||||
| LoggingOut | LoggingOut | ||||
| } | } | ||||
| } | } | ||||
| @@ -1,12 +1,15 @@ | |||||
| namespace Discord | namespace Discord | ||||
| { | { | ||||
| /// <summary> Contains options specific to requests </summary> | |||||
| public class RequestOptions | public class RequestOptions | ||||
| { | { | ||||
| /// <summary> Returns the default options for a request. </summary> | |||||
| public static RequestOptions Default => new RequestOptions(); | public static RequestOptions Default => new RequestOptions(); | ||||
| /// <summary> The max time, in milliseconds, to wait for this request to complete. If null, a request will not time out. If a rate limit has been triggered for this request's bucket and will not be unpaused in time, this request will fail immediately. </summary> | /// <summary> The max time, in milliseconds, to wait for this request to complete. If null, a request will not time out. If a rate limit has been triggered for this request's bucket and will not be unpaused in time, this request will fail immediately. </summary> | ||||
| public int? Timeout { get; set; } | public int? Timeout { get; set; } | ||||
| /// <summary> Creates a new instance of the RequestOptions class </summary> | |||||
| public RequestOptions() | public RequestOptions() | ||||
| { | { | ||||
| Timeout = 30000; | Timeout = 30000; | ||||