@@ -103,11 +103,11 @@ namespace Discord.Commands | |||||
throw new InvalidOperationException("Remainder parameters must be the last parameter in a command."); | throw new InvalidOperationException("Remainder parameters must be the last parameter in a command."); | ||||
string name = parameter.Name; | string name = parameter.Name; | ||||
string description = parameter.GetCustomAttribute<DescriptionAttribute>()?.Text; | |||||
string summary = parameter.GetCustomAttribute<DescriptionAttribute>()?.Text; | |||||
bool isOptional = parameter.IsOptional; | bool isOptional = parameter.IsOptional; | ||||
object defaultValue = parameter.HasDefaultValue ? parameter.DefaultValue : null; | 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(); | return paramBuilder.ToImmutable(); | ||||
} | } | ||||
@@ -10,17 +10,17 @@ namespace Discord.Commands | |||||
private readonly TypeReader _reader; | private readonly TypeReader _reader; | ||||
public string Name { get; } | public string Name { get; } | ||||
public string Description { get; } | |||||
public string Summary { get; } | |||||
public bool IsOptional { get; } | public bool IsOptional { get; } | ||||
public bool IsRemainder { get; } | public bool IsRemainder { get; } | ||||
public bool IsMultiple { get; } | public bool IsMultiple { get; } | ||||
public Type Type { get; } | public Type Type { get; } | ||||
internal object DefaultValue { 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; | Name = name; | ||||
Description = description; | |||||
Summary = summary; | |||||
Type = type; | Type = type; | ||||
_reader = reader; | _reader = reader; | ||||
IsOptional = isOptional; | IsOptional = isOptional; | ||||
@@ -16,7 +16,8 @@ namespace Discord.Commands | |||||
private readonly ConcurrentDictionary<Type, TypeReader> _typeReaders; | private readonly ConcurrentDictionary<Type, TypeReader> _typeReaders; | ||||
private readonly CommandMap _map; | 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() | public CommandService() | ||||
{ | { | ||||