From 27dc92cdcef770e7ec1bff3e8b90a153944ecbcf Mon Sep 17 00:00:00 2001 From: Joe4evr Date: Sun, 19 Aug 2018 19:09:31 +0200 Subject: [PATCH] Add a doc --- .../Attributes/NamedArgumentTypeAttribute.cs | 4 ++++ test/Discord.Net.Tests/Tests.TypeReaders.cs | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Discord.Net.Commands/Attributes/NamedArgumentTypeAttribute.cs b/src/Discord.Net.Commands/Attributes/NamedArgumentTypeAttribute.cs index 0899f6e1b..a43286110 100644 --- a/src/Discord.Net.Commands/Attributes/NamedArgumentTypeAttribute.cs +++ b/src/Discord.Net.Commands/Attributes/NamedArgumentTypeAttribute.cs @@ -2,6 +2,10 @@ using System; namespace Discord.Commands { + /// + /// Instructs the command system to treat command paramters of this type + /// as a collection of named arguments matching to its properties. + /// [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)] public sealed class NamedArgumentTypeAttribute : Attribute { } } diff --git a/test/Discord.Net.Tests/Tests.TypeReaders.cs b/test/Discord.Net.Tests/Tests.TypeReaders.cs index 63083bc6b..3d1325c59 100644 --- a/test/Discord.Net.Tests/Tests.TypeReaders.cs +++ b/test/Discord.Net.Tests/Tests.TypeReaders.cs @@ -25,7 +25,7 @@ namespace Discord Assert.NotNull(param); Assert.True(param.IsRemainder); - var result = await param.ParseAsync(null, "foo: 42 bar: hello"); + var result = await param.ParseAsync(null, "bar: hello foo: 42"); Assert.True(result.IsSuccess); var m = result.BestMatch as ArgumentType; @@ -51,7 +51,7 @@ namespace Discord Assert.NotNull(param); Assert.True(param.IsRemainder); - var result = await param.ParseAsync(null, "bar: 《hello》 foo: 42"); + var result = await param.ParseAsync(null, "foo: 42 bar: 《hello》"); Assert.True(result.IsSuccess); var m = result.BestMatch as ArgumentType;