Browse Source

Add XMLDocs

pull/988/head
Still Hsu 7 years ago
parent
commit
02570a4dd7
No known key found for this signature in database GPG Key ID: 8601A145FDA95209
6 changed files with 13 additions and 6 deletions
  1. +6
    -2
      src/Discord.Net.Commands/CommandService.cs
  2. +2
    -2
      src/Discord.Net.Commands/Extensions/MessageExtensions.cs
  3. +2
    -0
      src/Discord.Net.Commands/Results/TypeReaderResult.cs
  4. +1
    -1
      src/Discord.Net.Core/Entities/Messages/MessageProperties.cs
  5. +1
    -1
      src/Discord.Net.Rest/API/Common/InviteMetadata.cs
  6. +1
    -0
      src/Discord.Net.Rest/Entities/Channels/ChannelHelper.cs

+ 6
- 2
src/Discord.Net.Commands/CommandService.cs View File

@@ -60,10 +60,12 @@ namespace Discord.Commands
public CommandService() : this(new CommandServiceConfig()) { } public CommandService() : this(new CommandServiceConfig()) { }


/// <summary> /// <summary>
/// Initializes a new <see cref="CommandService" /> class with the provided configuration.
/// Initializes a new <see cref="CommandService"/> class with the provided configuration.
/// </summary> /// </summary>
/// <param name="config">The configuration class.</param> /// <param name="config">The configuration class.</param>
/// <exception cref="InvalidOperationException">The <see cref="RunMode"/> is set to <see cref="RunMode.Default"/>.</exception>
/// <exception cref="InvalidOperationException">
/// The <see cref="RunMode"/> cannot be set to <see cref="RunMode.Default"/>.
/// </exception>
public CommandService(CommandServiceConfig config) public CommandService(CommandServiceConfig config)
{ {
_caseSensitive = config.CaseSensitiveCommands; _caseSensitive = config.CaseSensitiveCommands;
@@ -132,6 +134,8 @@ namespace Discord.Commands
/// <returns> /// <returns>
/// A built module. /// A built module.
/// </returns> /// </returns>
/// <exception cref="ArgumentException">This module has already been added.</exception>
/// <exception cref="InvalidOperationException">The <see cref="ModuleInfo"/> fails to be built; an invalid type may have been provided.</exception>
public Task<ModuleInfo> AddModuleAsync<T>(IServiceProvider services) => AddModuleAsync(typeof(T), services); public Task<ModuleInfo> AddModuleAsync<T>(IServiceProvider services) => AddModuleAsync(typeof(T), services);


/// <summary> /// <summary>


+ 2
- 2
src/Discord.Net.Commands/Extensions/MessageExtensions.cs View File

@@ -8,7 +8,7 @@ namespace Discord.Commands
public static class MessageExtensions public static class MessageExtensions
{ {
/// <summary> /// <summary>
/// Gets whether the message starts with the provided <see langword="char" />.
/// Gets whether the message starts with the provided character.
/// </summary> /// </summary>
public static bool HasCharPrefix(this IUserMessage msg, char c, ref int argPos) public static bool HasCharPrefix(this IUserMessage msg, char c, ref int argPos)
{ {
@@ -21,7 +21,7 @@ namespace Discord.Commands
return false; return false;
} }
/// <summary> /// <summary>
/// Gets whether the message starts with the provided <see langword="string" />.
/// Gets whether the message starts with the provided string.
/// </summary> /// </summary>
public static bool HasStringPrefix(this IUserMessage msg, string str, ref int argPos, StringComparison comparisonType = StringComparison.Ordinal) public static bool HasStringPrefix(this IUserMessage msg, string str, ref int argPos, StringComparison comparisonType = StringComparison.Ordinal)
{ {


+ 2
- 0
src/Discord.Net.Commands/Results/TypeReaderResult.cs View File

@@ -34,6 +34,8 @@ namespace Discord.Commands


/// <inheritdoc/> /// <inheritdoc/>
public bool IsSuccess => !Error.HasValue; public bool IsSuccess => !Error.HasValue;

/// <exception cref="InvalidOperationException">TypeReaderResult was not successful.</exception>
public object BestMatch => IsSuccess public object BestMatch => IsSuccess
? (Values.Count == 1 ? Values.Single().Value : Values.OrderByDescending(v => v.Score).First().Value) ? (Values.Count == 1 ? Values.Single().Value : Values.OrderByDescending(v => v.Score).First().Value)
: throw new InvalidOperationException("TypeReaderResult was not successful."); : throw new InvalidOperationException("TypeReaderResult was not successful.");


+ 1
- 1
src/Discord.Net.Core/Entities/Messages/MessageProperties.cs View File

@@ -4,7 +4,7 @@ namespace Discord
/// Properties that are used to modify an <see cref="IUserMessage" /> with the specified changes. /// Properties that are used to modify an <see cref="IUserMessage" /> with the specified changes.
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// The content of a message can be cleared with <see cref="string.Empty"/> if and only if an <see cref="Discord.Embed"> is present.
/// The content of a message can be cleared with <see cref="string.Empty"/> if and only if an <see cref="Discord.Embed"/> is present.
/// </remarks> /// </remarks>
/// <example> /// <example>
/// <code lang="c#"> /// <code lang="c#">


+ 1
- 1
src/Discord.Net.Rest/API/Common/InviteMetadata.cs View File

@@ -1,4 +1,4 @@
#pragma warning disable CS1591
#pragma warning disable CS1591
using Newtonsoft.Json; using Newtonsoft.Json;
using System; using System;




+ 1
- 0
src/Discord.Net.Rest/Entities/Channels/ChannelHelper.cs View File

@@ -256,6 +256,7 @@ namespace Discord.Rest
} }


//Users //Users
/// <exception cref="InvalidOperationException">Resolving permissions requires the parent guild to be downloaded.</exception>
public static async Task<RestGuildUser> GetUserAsync(IGuildChannel channel, IGuild guild, BaseDiscordClient client, public static async Task<RestGuildUser> GetUserAsync(IGuildChannel channel, IGuild guild, BaseDiscordClient client,
ulong id, RequestOptions options) ulong id, RequestOptions options)
{ {


Loading…
Cancel
Save