Revert 3856d43 & rename CommandParameter.Description to Summary
This commit is contained in:
@@ -103,11 +103,11 @@ namespace Discord.Commands
|
||||
throw new InvalidOperationException("Remainder parameters must be the last parameter in a command.");
|
||||
|
||||
string name = parameter.Name;
|
||||
string description = parameter.GetCustomAttribute<DescriptionAttribute>()?.Text;
|
||||
string summary = parameter.GetCustomAttribute<DescriptionAttribute>()?.Text;
|
||||
bool isOptional = parameter.IsOptional;
|
||||
object defaultValue = parameter.HasDefaultValue ? parameter.DefaultValue : null;
|
||||
|
||||
paramBuilder.Add(new CommandParameter(name, description, type, reader, isOptional, isRemainder, isMultiple, defaultValue));
|
||||
paramBuilder.Add(new CommandParameter(name, summary, type, reader, isOptional, isRemainder, isMultiple, defaultValue));
|
||||
}
|
||||
return paramBuilder.ToImmutable();
|
||||
}
|
||||
|
||||
@@ -10,17 +10,17 @@ namespace Discord.Commands
|
||||
private readonly TypeReader _reader;
|
||||
|
||||
public string Name { get; }
|
||||
public string Description { get; }
|
||||
public string Summary { get; }
|
||||
public bool IsOptional { get; }
|
||||
public bool IsRemainder { get; }
|
||||
public bool IsMultiple { get; }
|
||||
public Type Type { get; }
|
||||
internal object DefaultValue { get; }
|
||||
|
||||
public CommandParameter(string name, string description, Type type, TypeReader reader, bool isOptional, bool isRemainder, bool isMultiple, object defaultValue)
|
||||
public CommandParameter(string name, string summary, Type type, TypeReader reader, bool isOptional, bool isRemainder, bool isMultiple, object defaultValue)
|
||||
{
|
||||
Name = name;
|
||||
Description = description;
|
||||
Summary = summary;
|
||||
Type = type;
|
||||
_reader = reader;
|
||||
IsOptional = isOptional;
|
||||
|
||||
@@ -16,7 +16,8 @@ namespace Discord.Commands
|
||||
private readonly ConcurrentDictionary<Type, TypeReader> _typeReaders;
|
||||
private readonly CommandMap _map;
|
||||
|
||||
public ILookup<Module, Command> Commands => _modules.SelectMany(x => x.Value.Commands).ToLookup(x => x.Module);
|
||||
public IEnumerable<Module> Modules => _modules.Select(x => x.Value);
|
||||
public IEnumerable<Command> Commands => _modules.SelectMany(x => x.Value.Commands);
|
||||
|
||||
public CommandService()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user