From 47089448dda3f15c791dd7db6625c0e64bdcc07c Mon Sep 17 00:00:00 2001 From: Finite Reality Date: Wed, 3 Aug 2016 16:33:26 +0100 Subject: [PATCH] Fix Synopsis/Description mix-up --- .../Attributes/DescriptionAttribute.cs | 8 ++++---- src/Discord.Net.Commands/Module.cs | 5 +++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/Discord.Net.Commands/Attributes/DescriptionAttribute.cs b/src/Discord.Net.Commands/Attributes/DescriptionAttribute.cs index 3a6942086..397d97512 100644 --- a/src/Discord.Net.Commands/Attributes/DescriptionAttribute.cs +++ b/src/Discord.Net.Commands/Attributes/DescriptionAttribute.cs @@ -2,8 +2,8 @@ namespace Discord.Commands { - // Full summary of method/parameter - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Parameter)] + // Full summary of method + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class)] public class DescriptionAttribute : Attribute { public string Text { get; } @@ -13,8 +13,8 @@ namespace Discord.Commands } } - // Brief summary of method/module - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class)] + // Brief summary of method/module/parameter + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class | AttributeTargets.Parameter)] public class SynopsisAttribute : Attribute { public string Text { get; } diff --git a/src/Discord.Net.Commands/Module.cs b/src/Discord.Net.Commands/Module.cs index e2b44c8bb..50b48f37c 100644 --- a/src/Discord.Net.Commands/Module.cs +++ b/src/Discord.Net.Commands/Module.cs @@ -10,6 +10,7 @@ namespace Discord.Commands public CommandService Service { get; } public string Name { get; } public string Synopsis { get; } + public string Description { get; } public IEnumerable Commands { get; } internal object Instance { get; } @@ -23,6 +24,10 @@ namespace Discord.Commands if (synopsisAttr != null) Synopsis = synopsisAttr.Text; + var descriptionAttr = typeInfo.GetCustomAttribute(); + if (descriptionAttr != null) + Description = descriptionAttr.Text; + List commands = new List(); SearchClass(instance, commands, typeInfo, moduleAttr.Prefix ?? ""); Commands = commands;