Browse Source

Added docstrings.

pull/785/head
AntiTcb 8 years ago
parent
commit
eea58420b6
1 changed files with 13 additions and 0 deletions
  1. +13
    -0
      src/Discord.Net.Commands/CommandService.cs

+ 13
- 0
src/Discord.Net.Commands/CommandService.cs View File

@@ -193,8 +193,20 @@ namespace Discord.Commands
} }


//Type Readers //Type Readers
/// <summary>
/// Adds a custom <see cref="TypeReader"/> to this <see cref="CommandService"/> for the supplied object type.
/// If <typeparamref name="T"/> is a <see cref="ValueType"/>, a <see cref="NullableTypeReader{T}"/> will also be added.
/// </summary>
/// <typeparam name="T">The object type to be read by the <see cref="TypeReader"/>.</typeparam>
/// <param name="reader">An instance of the <see cref="TypeReader"/> to be added.</param>
public void AddTypeReader<T>(TypeReader reader) public void AddTypeReader<T>(TypeReader reader)
=> AddTypeReader(typeof(T), reader); => AddTypeReader(typeof(T), reader);
/// <summary>
/// Adds a custom <see cref="TypeReader"/> to this <see cref="CommandService"/> for the supplied object type.
/// If <paramref name="type"/> is a <see cref="ValueType"/>, a <see cref="NullableTypeReader{T}"/> for the value type will also be added.
/// </summary>
/// <param name="type">A <see cref="Type"/> instance for the type to be read.</param>
/// <param name="reader">An instance of the <see cref="TypeReader"/> to be added.</param>
public void AddTypeReader(Type type, TypeReader reader) public void AddTypeReader(Type type, TypeReader reader)
{ {
var readers = _typeReaders.GetOrAdd(type, x => new ConcurrentDictionary<Type, TypeReader>()); var readers = _typeReaders.GetOrAdd(type, x => new ConcurrentDictionary<Type, TypeReader>());
@@ -241,6 +253,7 @@ namespace Discord.Commands
} }
return null; return null;
} }

//Execution //Execution
public SearchResult Search(ICommandContext context, int argPos) public SearchResult Search(ICommandContext context, int argPos)
=> Search(context, context.Message.Content.Substring(argPos)); => Search(context, context.Message.Content.Substring(argPos));


Loading…
Cancel
Save