From 7c60b0293b287e8eb0f2497bd007a6f764418957 Mon Sep 17 00:00:00 2001 From: Hsu Still <341464@gmail.com> Date: Wed, 21 Mar 2018 15:13:37 +0800 Subject: [PATCH] Add XMLDocs * Fix comments to comply with third-person commenting style + Various attributes + Various Command-related objects + Many more --- .../Attributes/CommandAttribute.cs | 7 ++++++ .../Preconditions/RequireBotPermissionAttribute.cs | 8 +++---- .../Preconditions/RequireContextAttribute.cs | 4 ++-- .../Preconditions/RequireNsfwAttribute.cs | 2 +- .../Preconditions/RequireOwnerAttribute.cs | 2 +- .../RequireUserPermissionAttribute.cs | 6 ++--- src/Discord.Net.Commands/CommandContext.cs | 8 ++++++- src/Discord.Net.Commands/CommandException.cs | 2 ++ src/Discord.Net.Commands/CommandMatch.cs | 4 +++- src/Discord.Net.Commands/Info/CommandInfo.cs | 26 ++++++++++++++++++++++ src/Discord.Net.Commands/MultiMatchHandling.cs | 4 +++- src/Discord.Net.Commands/Results/IResult.cs | 5 ++++- src/Discord.Net.Commands/Results/ParseResult.cs | 5 ++++- .../Results/PreconditionResult.cs | 5 ++++- src/Discord.Net.Commands/Results/RuntimeResult.cs | 6 ++++- src/Discord.Net.Commands/Results/SearchResult.cs | 5 ++++- .../Results/TypeReaderResult.cs | 5 ++++- src/Discord.Net.Commands/RunMode.cs | 2 +- src/Discord.Net.Core/CDN.cs | 1 + src/Discord.Net.Core/Commands/ICommandContext.cs | 7 +++++- .../Entities/Channels/GuildChannelProperties.cs | 10 ++++----- src/Discord.Net.Core/Entities/Emotes/Emoji.cs | 4 ++-- src/Discord.Net.Core/Entities/Emotes/Emote.cs | 10 ++++----- src/Discord.Net.Core/Entities/Emotes/GuildEmote.cs | 4 ++-- .../Entities/Guilds/GuildEmbedProperties.cs | 4 ++-- .../Entities/Guilds/GuildProperties.cs | 18 +++++++-------- .../Entities/Messages/IAttachment.cs | 1 + .../Entities/Messages/MessageProperties.cs | 8 +++---- .../Entities/Users/GuildUserProperties.cs | 8 +++---- src/Discord.Net.Core/Utils/MentionUtils.cs | 1 + .../Entities/Messages/Attachment.cs | 2 ++ 31 files changed, 129 insertions(+), 55 deletions(-) diff --git a/src/Discord.Net.Commands/Attributes/CommandAttribute.cs b/src/Discord.Net.Commands/Attributes/CommandAttribute.cs index 5f8e9ceaf..e1fc59a73 100644 --- a/src/Discord.Net.Commands/Attributes/CommandAttribute.cs +++ b/src/Discord.Net.Commands/Attributes/CommandAttribute.cs @@ -2,10 +2,17 @@ using System; namespace Discord.Commands { + /// Provides the execution information for a command. [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)] public class CommandAttribute : Attribute { + /// + /// Specifies the text required to be recognized as a command. + /// public string Text { get; } + /// + /// Specifies the of the command. This affects how the command is executed. + /// public RunMode RunMode { get; set; } = RunMode.Default; public CommandAttribute() diff --git a/src/Discord.Net.Commands/Attributes/Preconditions/RequireBotPermissionAttribute.cs b/src/Discord.Net.Commands/Attributes/Preconditions/RequireBotPermissionAttribute.cs index 104252799..1afe82685 100644 --- a/src/Discord.Net.Commands/Attributes/Preconditions/RequireBotPermissionAttribute.cs +++ b/src/Discord.Net.Commands/Attributes/Preconditions/RequireBotPermissionAttribute.cs @@ -1,10 +1,10 @@ -using System; +using System; using System.Threading.Tasks; namespace Discord.Commands { /// - /// This attribute requires that the bot has a specified permission in the channel a command is invoked in. + /// This attribute requires the bot to have a specific permission in the channel a command is invoked in. /// [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true, Inherited = true)] public class RequireBotPermissionAttribute : PreconditionAttribute @@ -13,7 +13,7 @@ namespace Discord.Commands public ChannelPermission? ChannelPermission { get; } /// - /// Require that the bot account has a specified GuildPermission + /// Requires that the bot account to have a specific . /// /// This precondition will always fail if the command is being invoked in a private channel. /// The GuildPermission that the bot must have. Multiple permissions can be specified by ORing the permissions together. @@ -23,7 +23,7 @@ namespace Discord.Commands ChannelPermission = null; } /// - /// Require that the bot account has a specified ChannelPermission. + /// Requires that the bot account to have a specific . /// /// The ChannelPermission that the bot must have. Multiple permissions can be specified by ORing the permissions together. /// diff --git a/src/Discord.Net.Commands/Attributes/Preconditions/RequireContextAttribute.cs b/src/Discord.Net.Commands/Attributes/Preconditions/RequireContextAttribute.cs index 90af035e4..252d8b5f2 100644 --- a/src/Discord.Net.Commands/Attributes/Preconditions/RequireContextAttribute.cs +++ b/src/Discord.Net.Commands/Attributes/Preconditions/RequireContextAttribute.cs @@ -13,7 +13,7 @@ namespace Discord.Commands } /// - /// Require that the command be invoked in a specified context. + /// This attribute requires that the command be invoked in a specified context. (e.g. in guild, DM) /// [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true, Inherited = true)] public class RequireContextAttribute : PreconditionAttribute @@ -21,7 +21,7 @@ namespace Discord.Commands public ContextType Contexts { get; } /// - /// Require that the command be invoked in a specified context. + /// Requires that the command be invoked in the specified context. /// /// The type of context the command can be invoked in. Multiple contexts can be specified by ORing the contexts together. /// diff --git a/src/Discord.Net.Commands/Attributes/Preconditions/RequireNsfwAttribute.cs b/src/Discord.Net.Commands/Attributes/Preconditions/RequireNsfwAttribute.cs index 273c764bd..baff01d8c 100644 --- a/src/Discord.Net.Commands/Attributes/Preconditions/RequireNsfwAttribute.cs +++ b/src/Discord.Net.Commands/Attributes/Preconditions/RequireNsfwAttribute.cs @@ -4,7 +4,7 @@ using System.Threading.Tasks; namespace Discord.Commands { /// - /// Require that the command is invoked in a channel marked NSFW + /// This attribute requires that the command to be invoked in a channel marked NSFW. /// [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true, Inherited = true)] public class RequireNsfwAttribute : PreconditionAttribute diff --git a/src/Discord.Net.Commands/Attributes/Preconditions/RequireOwnerAttribute.cs b/src/Discord.Net.Commands/Attributes/Preconditions/RequireOwnerAttribute.cs index 93e3cbe18..bf6a3352e 100644 --- a/src/Discord.Net.Commands/Attributes/Preconditions/RequireOwnerAttribute.cs +++ b/src/Discord.Net.Commands/Attributes/Preconditions/RequireOwnerAttribute.cs @@ -4,7 +4,7 @@ using System.Threading.Tasks; namespace Discord.Commands { /// - /// Require that the command is invoked by the owner of the bot. + /// This attribute requires that the command to be invoked by the owner of the bot. /// /// This precondition will only work if the bot is a bot account. [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true, Inherited = true)] diff --git a/src/Discord.Net.Commands/Attributes/Preconditions/RequireUserPermissionAttribute.cs b/src/Discord.Net.Commands/Attributes/Preconditions/RequireUserPermissionAttribute.cs index 14121f35b..7aaeab064 100644 --- a/src/Discord.Net.Commands/Attributes/Preconditions/RequireUserPermissionAttribute.cs +++ b/src/Discord.Net.Commands/Attributes/Preconditions/RequireUserPermissionAttribute.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Threading.Tasks; namespace Discord.Commands @@ -13,7 +13,7 @@ namespace Discord.Commands public ChannelPermission? ChannelPermission { get; } /// - /// Require that the user invoking the command has a specified GuildPermission + /// Requires that the user invoking the command to have a specific . /// /// This precondition will always fail if the command is being invoked in a private channel. /// The GuildPermission that the user must have. Multiple permissions can be specified by ORing the permissions together. @@ -23,7 +23,7 @@ namespace Discord.Commands ChannelPermission = null; } /// - /// Require that the user invoking the command has a specified ChannelPermission. + /// Requires that the user invoking the command to have a specific . /// /// The ChannelPermission that the user must have. Multiple permissions can be specified by ORing the permissions together. /// diff --git a/src/Discord.Net.Commands/CommandContext.cs b/src/Discord.Net.Commands/CommandContext.cs index 05bde56b1..d884d8b29 100644 --- a/src/Discord.Net.Commands/CommandContext.cs +++ b/src/Discord.Net.Commands/CommandContext.cs @@ -1,13 +1,19 @@ -namespace Discord.Commands +namespace Discord.Commands { public class CommandContext : ICommandContext { + /// public IDiscordClient Client { get; } + /// public IGuild Guild { get; } + /// public IMessageChannel Channel { get; } + /// public IUser User { get; } + /// public IUserMessage Message { get; } + /// Indicates whether the channel that the command is executed in is a private channel. public bool IsPrivate => Channel is IPrivateChannel; public CommandContext(IDiscordClient client, IUserMessage msg) diff --git a/src/Discord.Net.Commands/CommandException.cs b/src/Discord.Net.Commands/CommandException.cs index d5300841a..1584641b3 100644 --- a/src/Discord.Net.Commands/CommandException.cs +++ b/src/Discord.Net.Commands/CommandException.cs @@ -4,7 +4,9 @@ namespace Discord.Commands { public class CommandException : Exception { + /// The command that caused the exception. public CommandInfo Command { get; } + /// The command context of the exception. public ICommandContext Context { get; } public CommandException(CommandInfo command, ICommandContext context, Exception ex) diff --git a/src/Discord.Net.Commands/CommandMatch.cs b/src/Discord.Net.Commands/CommandMatch.cs index d922a2229..6411ef084 100644 --- a/src/Discord.Net.Commands/CommandMatch.cs +++ b/src/Discord.Net.Commands/CommandMatch.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; @@ -7,7 +7,9 @@ namespace Discord.Commands { public struct CommandMatch { + /// The command that matches the search result. public CommandInfo Command { get; } + /// The alias of the command. public string Alias { get; } public CommandMatch(CommandInfo command, string alias) diff --git a/src/Discord.Net.Commands/Info/CommandInfo.cs b/src/Discord.Net.Commands/Info/CommandInfo.cs index f0d406e8d..75f3f56eb 100644 --- a/src/Discord.Net.Commands/Info/CommandInfo.cs +++ b/src/Discord.Net.Commands/Info/CommandInfo.cs @@ -12,6 +12,11 @@ using Microsoft.Extensions.DependencyInjection; namespace Discord.Commands { + /// The information of a command. + /// + /// This object contains the information of a command. + /// This can include the module of the command, various descriptions regarding the command, and its . + /// [DebuggerDisplay("{Name,nq}")] public class CommandInfo { @@ -21,17 +26,36 @@ namespace Discord.Commands private readonly CommandService _commandService; private readonly Func _action; + /// The module that the command belongs in. public ModuleInfo Module { get; } + /// Name of the command. If none is set, the first alias is used. public string Name { get; } + /// Summary of the command. + /// + /// This field returns the summary of the command. + /// Summary and remarks can be useful in help commands and various implementation that fetches details of the command for the user. + /// public string Summary { get; } + /// Remarks of the command. + /// + /// This field returns the remarks of the command. + /// Summary and remarks can be useful in help commands and various implementation that fetches details of the command for the user. + /// public string Remarks { get; } + /// The priority of the command. This is used when there are multiple overloads of the command. public int Priority { get; } + /// Indicates whether the command accepts a [] for its parameter. public bool HasVarArgs { get; } + /// Indicates the that is being used for the command. public RunMode RunMode { get; } + /// List of aliases defined by the of the command. public IReadOnlyList Aliases { get; } + /// List of information about the parameters of the command. public IReadOnlyList Parameters { get; } + /// List of preconditions defined by the of the command. public IReadOnlyList Preconditions { get; } + /// List of attributes of the command. public IReadOnlyList Attributes { get; } internal CommandInfo(CommandBuilder builder, ModuleInfo module, CommandService service) @@ -122,6 +146,7 @@ namespace Discord.Commands return await CommandParser.ParseArgsAsync(this, context, _commandService._ignoreExtraArgs, services, input, 0).ConfigureAwait(false); } + /// Executes the command with the provided context, parsed value, and service provider. public Task ExecuteAsync(ICommandContext context, ParseResult parseResult, IServiceProvider services) { if (!parseResult.IsSuccess) @@ -145,6 +170,7 @@ namespace Discord.Commands return ExecuteAsync(context, argList, paramList, services); } + /// Executes the command with the provided context, argument and parameter list, and service provider. public async Task ExecuteAsync(ICommandContext context, IEnumerable argList, IEnumerable paramList, IServiceProvider services) { services = services ?? EmptyServiceProvider.Instance; diff --git a/src/Discord.Net.Commands/MultiMatchHandling.cs b/src/Discord.Net.Commands/MultiMatchHandling.cs index 89dcf1c06..5dc84e266 100644 --- a/src/Discord.Net.Commands/MultiMatchHandling.cs +++ b/src/Discord.Net.Commands/MultiMatchHandling.cs @@ -1,8 +1,10 @@ -namespace Discord.Commands +namespace Discord.Commands { public enum MultiMatchHandling { + /// Indicates that when multiple results are found, an exception should be thrown. Exception, + /// Indicates that when multiple results are found, the best result should be chosen. Best } } diff --git a/src/Discord.Net.Commands/Results/IResult.cs b/src/Discord.Net.Commands/Results/IResult.cs index 928d1139e..cc5d4c3be 100644 --- a/src/Discord.Net.Commands/Results/IResult.cs +++ b/src/Discord.Net.Commands/Results/IResult.cs @@ -1,9 +1,12 @@ -namespace Discord.Commands +namespace Discord.Commands { public interface IResult { + /// Describes the error type that may have occurred during the operation. CommandError? Error { get; } + /// Describes the reason for the error. string ErrorReason { get; } + /// Indicates whether the operation was successful or not. bool IsSuccess { get; } } } diff --git a/src/Discord.Net.Commands/Results/ParseResult.cs b/src/Discord.Net.Commands/Results/ParseResult.cs index d4a9af521..f128ab7a9 100644 --- a/src/Discord.Net.Commands/Results/ParseResult.cs +++ b/src/Discord.Net.Commands/Results/ParseResult.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Diagnostics; namespace Discord.Commands @@ -9,9 +9,12 @@ namespace Discord.Commands public IReadOnlyList ArgValues { get; } public IReadOnlyList ParamValues { get; } + /// public CommandError? Error { get; } + /// public string ErrorReason { get; } + /// public bool IsSuccess => !Error.HasValue; private ParseResult(IReadOnlyList argValues, IReadOnlyList paramValues, CommandError? error, string errorReason) diff --git a/src/Discord.Net.Commands/Results/PreconditionResult.cs b/src/Discord.Net.Commands/Results/PreconditionResult.cs index ca65a373e..beb156b33 100644 --- a/src/Discord.Net.Commands/Results/PreconditionResult.cs +++ b/src/Discord.Net.Commands/Results/PreconditionResult.cs @@ -1,13 +1,16 @@ -using System.Diagnostics; +using System.Diagnostics; namespace Discord.Commands { [DebuggerDisplay(@"{DebuggerDisplay,nq}")] public class PreconditionResult : IResult { + /// public CommandError? Error { get; } + /// public string ErrorReason { get; } + /// public bool IsSuccess => !Error.HasValue; protected PreconditionResult(CommandError? error, string errorReason) diff --git a/src/Discord.Net.Commands/Results/RuntimeResult.cs b/src/Discord.Net.Commands/Results/RuntimeResult.cs index 2a326a7a3..73c8b9066 100644 --- a/src/Discord.Net.Commands/Results/RuntimeResult.cs +++ b/src/Discord.Net.Commands/Results/RuntimeResult.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics; using System.Text; @@ -14,11 +14,15 @@ namespace Discord.Commands Reason = reason; } + /// public CommandError? Error { get; } + /// Describes the execution reason or result. public string Reason { get; } + /// public bool IsSuccess => !Error.HasValue; + /// string IResult.ErrorReason => Reason; public override string ToString() => Reason ?? (IsSuccess ? "Successful" : "Unsuccessful"); diff --git a/src/Discord.Net.Commands/Results/SearchResult.cs b/src/Discord.Net.Commands/Results/SearchResult.cs index 87d900d4d..65f627ab0 100644 --- a/src/Discord.Net.Commands/Results/SearchResult.cs +++ b/src/Discord.Net.Commands/Results/SearchResult.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Diagnostics; namespace Discord.Commands @@ -9,9 +9,12 @@ namespace Discord.Commands public string Text { get; } public IReadOnlyList Commands { get; } + /// public CommandError? Error { get; } + /// public string ErrorReason { get; } + /// public bool IsSuccess => !Error.HasValue; private SearchResult(string text, IReadOnlyList commands, CommandError? error, string errorReason) diff --git a/src/Discord.Net.Commands/Results/TypeReaderResult.cs b/src/Discord.Net.Commands/Results/TypeReaderResult.cs index 68bc359c6..49dd96b63 100644 --- a/src/Discord.Net.Commands/Results/TypeReaderResult.cs +++ b/src/Discord.Net.Commands/Results/TypeReaderResult.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Diagnostics; @@ -26,9 +26,12 @@ namespace Discord.Commands { public IReadOnlyCollection Values { get; } + /// public CommandError? Error { get; } + /// public string ErrorReason { get; } + /// public bool IsSuccess => !Error.HasValue; private TypeReaderResult(IReadOnlyCollection values, CommandError? error, string errorReason) diff --git a/src/Discord.Net.Commands/RunMode.cs b/src/Discord.Net.Commands/RunMode.cs index 751af1ebf..b5ab1116b 100644 --- a/src/Discord.Net.Commands/RunMode.cs +++ b/src/Discord.Net.Commands/RunMode.cs @@ -3,7 +3,7 @@ namespace Discord.Commands public enum RunMode { /// - /// Default behaviour set in . + /// The default behaviour set in . /// Default, /// diff --git a/src/Discord.Net.Core/CDN.cs b/src/Discord.Net.Core/CDN.cs index f18adbd7c..b8aa2084f 100644 --- a/src/Discord.Net.Core/CDN.cs +++ b/src/Discord.Net.Core/CDN.cs @@ -2,6 +2,7 @@ using System; namespace Discord { + /// Contains the strings related to various Content Delievery Networks (CDNs). public static class CDN { /// Returns the Discord developer application icon. diff --git a/src/Discord.Net.Core/Commands/ICommandContext.cs b/src/Discord.Net.Core/Commands/ICommandContext.cs index ac1424339..e0ea18ca8 100644 --- a/src/Discord.Net.Core/Commands/ICommandContext.cs +++ b/src/Discord.Net.Core/Commands/ICommandContext.cs @@ -1,11 +1,16 @@ -namespace Discord.Commands +namespace Discord.Commands { public interface ICommandContext { + /// The Discord client of which the command is executed with. IDiscordClient Client { get; } + /// The guild of which the command is executed in. IGuild Guild { get; } + /// The channel of which the command is executed in. IMessageChannel Channel { get; } + /// The user who executed the command. IUser User { get; } + /// The message of which the command is interpreted from. IUserMessage Message { get; } } } diff --git a/src/Discord.Net.Core/Entities/Channels/GuildChannelProperties.cs b/src/Discord.Net.Core/Entities/Channels/GuildChannelProperties.cs index 2ac6c8d52..09703bd65 100644 --- a/src/Discord.Net.Core/Entities/Channels/GuildChannelProperties.cs +++ b/src/Discord.Net.Core/Entities/Channels/GuildChannelProperties.cs @@ -1,7 +1,7 @@ -namespace Discord +namespace Discord { /// - /// Modify an IGuildChannel with the specified changes. + /// Properties that are used to modify an with the specified changes. /// /// /// @@ -14,7 +14,7 @@ public class GuildChannelProperties { /// - /// Set the channel to this name + /// Sets the channel to this name. /// /// /// When modifying an ITextChannel, the Name MUST be alphanumeric with dashes. @@ -23,11 +23,11 @@ /// A BadRequest will be thrown if the name does not match the above RegEx. public Optional Name { get; set; } /// - /// Move the channel to the following position. This is 0-based! + /// Moves the channel to the following position. This is 0-based! /// public Optional Position { get; set; } /// - /// Sets the category for this channel + /// Sets the category for this channel. /// public Optional CategoryId { get; set; } } diff --git a/src/Discord.Net.Core/Entities/Emotes/Emoji.cs b/src/Discord.Net.Core/Entities/Emotes/Emoji.cs index c2dfc31ad..1b2d7beb2 100644 --- a/src/Discord.Net.Core/Entities/Emotes/Emoji.cs +++ b/src/Discord.Net.Core/Entities/Emotes/Emoji.cs @@ -1,7 +1,7 @@ -namespace Discord +namespace Discord { /// - /// A unicode emoji + /// A unicode emoji. /// public class Emoji : IEmote { diff --git a/src/Discord.Net.Core/Entities/Emotes/Emote.cs b/src/Discord.Net.Core/Entities/Emotes/Emote.cs index e3a228c83..6488e320d 100644 --- a/src/Discord.Net.Core/Entities/Emotes/Emote.cs +++ b/src/Discord.Net.Core/Entities/Emotes/Emote.cs @@ -1,19 +1,19 @@ -using System; +using System; using System.Globalization; namespace Discord { /// - /// A custom image-based emote + /// A custom image-based emote. /// public class Emote : IEmote, ISnowflakeEntity { /// - /// The display name (tooltip) of this emote + /// The display name (tooltip) of this emote. /// public string Name { get; } /// - /// The ID of this emote + /// The ID of this emote. /// public ulong Id { get; } /// @@ -50,7 +50,7 @@ namespace Discord } /// - /// Parse an Emote from its raw format + /// Parses an Emote from its raw format. /// /// The raw encoding of an emote; for example, <:dab:277855270321782784> /// An emote diff --git a/src/Discord.Net.Core/Entities/Emotes/GuildEmote.cs b/src/Discord.Net.Core/Entities/Emotes/GuildEmote.cs index 95b062bd2..fec5519e5 100644 --- a/src/Discord.Net.Core/Entities/Emotes/GuildEmote.cs +++ b/src/Discord.Net.Core/Entities/Emotes/GuildEmote.cs @@ -1,10 +1,10 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Diagnostics; namespace Discord { /// - /// An image-based emote that is attached to a guild + /// An image-based emote that is attached to a guild. /// [DebuggerDisplay(@"{DebuggerDisplay,nq}")] public class GuildEmote : Emote diff --git a/src/Discord.Net.Core/Entities/Guilds/GuildEmbedProperties.cs b/src/Discord.Net.Core/Entities/Guilds/GuildEmbedProperties.cs index a2b2ec4fc..62bb8dfa9 100644 --- a/src/Discord.Net.Core/Entities/Guilds/GuildEmbedProperties.cs +++ b/src/Discord.Net.Core/Entities/Guilds/GuildEmbedProperties.cs @@ -1,7 +1,7 @@ -namespace Discord +namespace Discord { /// - /// Modify the widget of an IGuild with the specified parameters + /// Properties that are used to modify the widget of an with the specified parameters. /// public class GuildEmbedProperties { diff --git a/src/Discord.Net.Core/Entities/Guilds/GuildProperties.cs b/src/Discord.Net.Core/Entities/Guilds/GuildProperties.cs index 1b406ef7f..d98d7815a 100644 --- a/src/Discord.Net.Core/Entities/Guilds/GuildProperties.cs +++ b/src/Discord.Net.Core/Entities/Guilds/GuildProperties.cs @@ -1,7 +1,7 @@ -namespace Discord +namespace Discord { /// - /// Modify an IGuild with the specified changes + /// Properties that are used to modify an with the specified changes. /// /// /// @@ -17,23 +17,23 @@ { public Optional Username { get; set; } /// - /// The name of the Guild + /// The name of the Guild. /// public Optional Name { get; set; } /// - /// The region for the Guild's voice connections + /// The region for the Guild's voice connections. /// public Optional Region { get; set; } /// - /// The ID of the region for the Guild's voice connections + /// The ID of the region for the Guild's voice connections. /// public Optional RegionId { get; set; } /// - /// What verification level new users need to achieve before speaking + /// What verification level new users need to achieve before speaking. /// public Optional VerificationLevel { get; set; } /// - /// The default message notification state for the guild + /// The default message notification state for the guild. /// public Optional DefaultMessageNotifications { get; set; } /// @@ -41,11 +41,11 @@ /// public Optional AfkTimeout { get; set; } /// - /// The icon of the guild + /// The icon of the guild. /// public Optional Icon { get; set; } /// - /// The guild's splash image + /// The guild's splash image. /// /// /// The guild must be partnered for this value to have any effect. diff --git a/src/Discord.Net.Core/Entities/Messages/IAttachment.cs b/src/Discord.Net.Core/Entities/Messages/IAttachment.cs index d0f99ba4a..90b3f28ba 100644 --- a/src/Discord.Net.Core/Entities/Messages/IAttachment.cs +++ b/src/Discord.Net.Core/Entities/Messages/IAttachment.cs @@ -1,5 +1,6 @@ namespace Discord { + /// The interface that defines an attachment object. public interface IAttachment { /// The snowflake ID of the attachment. diff --git a/src/Discord.Net.Core/Entities/Messages/MessageProperties.cs b/src/Discord.Net.Core/Entities/Messages/MessageProperties.cs index b3f3a9c89..bb6dcbe0f 100644 --- a/src/Discord.Net.Core/Entities/Messages/MessageProperties.cs +++ b/src/Discord.Net.Core/Entities/Messages/MessageProperties.cs @@ -1,7 +1,7 @@ -namespace Discord +namespace Discord { /// - /// Modify a message with the specified parameters. + /// Properties that are used to modify a message with the specified parameters. /// /// /// The content of a message can be cleared with String.Empty; if and only if an Embed is present. @@ -23,14 +23,14 @@ public class MessageProperties { /// - /// The content of the message + /// The content of the message. /// /// /// This must be less than 2000 characters. /// public Optional Content { get; set; } /// - /// The embed the message should display + /// The embed the message should display. /// public Optional Embed { get; set; } } diff --git a/src/Discord.Net.Core/Entities/Users/GuildUserProperties.cs b/src/Discord.Net.Core/Entities/Users/GuildUserProperties.cs index 1c5e5482c..32d892e96 100644 --- a/src/Discord.Net.Core/Entities/Users/GuildUserProperties.cs +++ b/src/Discord.Net.Core/Entities/Users/GuildUserProperties.cs @@ -1,9 +1,9 @@ -using System.Collections.Generic; +using System.Collections.Generic; namespace Discord { /// - /// Modify an IGuildUser with the following parameters. + /// Properties that are used to modify an with the following parameters. /// /// /// @@ -54,14 +54,14 @@ namespace Discord /// public Optional> RoleIds { get; set; } /// - /// Move a user to a voice channel. + /// Moves a user to a voice channel. /// /// /// This user MUST already be in a Voice Channel for this to work. /// public Optional Channel { get; set; } /// - /// Move a user to a voice channel. + /// Moves a user to a voice channel. /// /// /// This user MUST already be in a Voice Channel for this to work. diff --git a/src/Discord.Net.Core/Utils/MentionUtils.cs b/src/Discord.Net.Core/Utils/MentionUtils.cs index bdc4a80ae..c510c7b3f 100644 --- a/src/Discord.Net.Core/Utils/MentionUtils.cs +++ b/src/Discord.Net.Core/Utils/MentionUtils.cs @@ -4,6 +4,7 @@ using System.Text; namespace Discord { + /// A helper class for mention-related parsing. public static class MentionUtils { private const char SanitizeChar = '\x200b'; diff --git a/src/Discord.Net.Rest/Entities/Messages/Attachment.cs b/src/Discord.Net.Rest/Entities/Messages/Attachment.cs index 9d3912bfc..f33380ce3 100644 --- a/src/Discord.Net.Rest/Entities/Messages/Attachment.cs +++ b/src/Discord.Net.Rest/Entities/Messages/Attachment.cs @@ -3,6 +3,7 @@ using Model = Discord.API.Attachment; namespace Discord { + /// A Discord attachment. [DebuggerDisplay(@"{DebuggerDisplay,nq}")] public class Attachment : IAttachment { @@ -38,6 +39,7 @@ namespace Discord model.Width.IsSpecified ? model.Width.Value : (int?)null); } + /// Returns the filename of the attachment. public override string ToString() => Filename; private string DebuggerDisplay => $"{Filename} ({Size} bytes)"; }