diff --git a/src/Discord.Net.Commands/Attributes/DescriptionAttribute.cs b/src/Discord.Net.Commands/Attributes/DescriptionAttribute.cs index db9c57057..3a6942086 100644 --- a/src/Discord.Net.Commands/Attributes/DescriptionAttribute.cs +++ b/src/Discord.Net.Commands/Attributes/DescriptionAttribute.cs @@ -2,6 +2,7 @@ namespace Discord.Commands { + // Full summary of method/parameter [AttributeUsage(AttributeTargets.Method | AttributeTargets.Parameter)] public class DescriptionAttribute : Attribute { @@ -12,7 +13,8 @@ namespace Discord.Commands } } - [AttributeUsage(AttributeTargets.Method)] + // Brief summary of method/module + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class)] public class SynopsisAttribute : Attribute { public string Text { get; } diff --git a/src/Discord.Net.Commands/Command.cs b/src/Discord.Net.Commands/Command.cs index 5729e4c81..e49245c49 100644 --- a/src/Discord.Net.Commands/Command.cs +++ b/src/Discord.Net.Commands/Command.cs @@ -103,7 +103,7 @@ namespace Discord.Commands throw new InvalidOperationException("Remainder parameters must be the last parameter in a command."); string name = parameter.Name; - string description = typeInfo.GetCustomAttribute()?.Text; + string description = parameter.GetCustomAttribute()?.Text; bool isOptional = parameter.IsOptional; object defaultValue = parameter.HasDefaultValue ? parameter.DefaultValue : null; diff --git a/src/Discord.Net.Commands/Module.cs b/src/Discord.Net.Commands/Module.cs index b884832bc..e2b44c8bb 100644 --- a/src/Discord.Net.Commands/Module.cs +++ b/src/Discord.Net.Commands/Module.cs @@ -9,6 +9,7 @@ namespace Discord.Commands { public CommandService Service { get; } public string Name { get; } + public string Synopsis { get; } public IEnumerable Commands { get; } internal object Instance { get; } @@ -18,6 +19,10 @@ namespace Discord.Commands Name = typeInfo.Name; Instance = instance; + var synopsisAttr = typeInfo.GetCustomAttribute(); + if (synopsisAttr != null) + Synopsis = synopsisAttr.Text; + List commands = new List(); SearchClass(instance, commands, typeInfo, moduleAttr.Prefix ?? ""); Commands = commands;