Revert "Renamed the Description/Summary Attributes to Summary/Remarks, as per the discussion in 239"
This reverts commit afc30bf412.
This commit is contained in:
@@ -2,13 +2,13 @@
|
|||||||
|
|
||||||
namespace Discord.Commands
|
namespace Discord.Commands
|
||||||
{
|
{
|
||||||
// Extension of the Cosmetic Summary, for Groups and Commands
|
// Full summary of method
|
||||||
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class)]
|
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class)]
|
||||||
public class RemarksAttribute : Attribute
|
public class DescriptionAttribute : Attribute
|
||||||
{
|
{
|
||||||
public string Text { get; }
|
public string Text { get; }
|
||||||
|
|
||||||
public RemarksAttribute(string text)
|
public DescriptionAttribute(string text)
|
||||||
{
|
{
|
||||||
Text = text;
|
Text = text;
|
||||||
}
|
}
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace Discord.Commands
|
namespace Discord.Commands
|
||||||
{
|
{
|
||||||
// Cosmetic Description for Groups, Commands, and Parameters
|
// Brief summary of method/module/parameter
|
||||||
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class | AttributeTargets.Parameter)]
|
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class | AttributeTargets.Parameter)]
|
||||||
public class SummaryAttribute : Attribute
|
public class SummaryAttribute : Attribute
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -21,8 +21,8 @@ namespace Discord.Commands
|
|||||||
public MethodInfo Source { get; }
|
public MethodInfo Source { get; }
|
||||||
public Module Module { get; }
|
public Module Module { get; }
|
||||||
public string Name { get; }
|
public string Name { get; }
|
||||||
|
public string Description { get; }
|
||||||
public string Summary { get; }
|
public string Summary { get; }
|
||||||
public string Remarks { get; }
|
|
||||||
public string Text { get; }
|
public string Text { get; }
|
||||||
public bool HasVarArgs { get; }
|
public bool HasVarArgs { get; }
|
||||||
public IReadOnlyList<string> Aliases { get; }
|
public IReadOnlyList<string> Aliases { get; }
|
||||||
@@ -62,14 +62,14 @@ namespace Discord.Commands
|
|||||||
if (nameAttr != null)
|
if (nameAttr != null)
|
||||||
Name = nameAttr.Text;
|
Name = nameAttr.Text;
|
||||||
|
|
||||||
|
var description = source.GetCustomAttribute<DescriptionAttribute>();
|
||||||
|
if (description != null)
|
||||||
|
Description = description.Text;
|
||||||
|
|
||||||
var summary = source.GetCustomAttribute<SummaryAttribute>();
|
var summary = source.GetCustomAttribute<SummaryAttribute>();
|
||||||
if (summary != null)
|
if (summary != null)
|
||||||
Summary = summary.Text;
|
Summary = summary.Text;
|
||||||
|
|
||||||
var remarksAttr = source.GetCustomAttribute<RemarksAttribute>();
|
|
||||||
if (remarksAttr != null)
|
|
||||||
Remarks = remarksAttr.Text;
|
|
||||||
|
|
||||||
Parameters = BuildParameters(source);
|
Parameters = BuildParameters(source);
|
||||||
HasVarArgs = Parameters.Count > 0 ? Parameters[Parameters.Count - 1].IsMultiple : false;
|
HasVarArgs = Parameters.Count > 0 ? Parameters[Parameters.Count - 1].IsMultiple : false;
|
||||||
Preconditions = BuildPreconditions(source);
|
Preconditions = BuildPreconditions(source);
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ namespace Discord.Commands
|
|||||||
public string Name { get; }
|
public string Name { get; }
|
||||||
public string Prefix { get; }
|
public string Prefix { get; }
|
||||||
public string Summary { get; }
|
public string Summary { get; }
|
||||||
public string Remarks { get; }
|
public string Description { get; }
|
||||||
public IEnumerable<Command> Commands { get; }
|
public IEnumerable<Command> Commands { get; }
|
||||||
internal object Instance { get; }
|
internal object Instance { get; }
|
||||||
|
|
||||||
@@ -35,9 +35,9 @@ namespace Discord.Commands
|
|||||||
if (summaryAttr != null)
|
if (summaryAttr != null)
|
||||||
Summary = summaryAttr.Text;
|
Summary = summaryAttr.Text;
|
||||||
|
|
||||||
var remarksAttr = source.GetCustomAttribute<RemarksAttribute>();
|
var descriptionAttr = source.GetCustomAttribute<DescriptionAttribute>();
|
||||||
if (remarksAttr != null)
|
if (descriptionAttr != null)
|
||||||
Remarks = remarksAttr.Text;
|
Description = descriptionAttr.Text;
|
||||||
|
|
||||||
List<Command> commands = new List<Command>();
|
List<Command> commands = new List<Command>();
|
||||||
SearchClass(source, instance, commands, Prefix, dependencyMap);
|
SearchClass(source, instance, commands, Prefix, dependencyMap);
|
||||||
|
|||||||
Reference in New Issue
Block a user