Browse Source

Exposed CommandParameter's Type

pull/163/head
RogueException 9 years ago
parent
commit
02d5fc4a8e
2 changed files with 6 additions and 3 deletions
  1. +1
    -1
      src/Discord.Net.Commands/Command.cs
  2. +5
    -2
      src/Discord.Net.Commands/CommandParameter.cs

+ 1
- 1
src/Discord.Net.Commands/Command.cs View File

@@ -96,7 +96,7 @@ namespace Discord.Commands
bool isOptional = parameter.IsOptional;
object defaultValue = parameter.HasDefaultValue ? parameter.DefaultValue : null;

paramBuilder.Add(new CommandParameter(name, description, reader, isOptional, isRemainder, defaultValue));
paramBuilder.Add(new CommandParameter(name, description, type, reader, isOptional, isRemainder, defaultValue));
}
return paramBuilder.ToImmutable();
}


+ 5
- 2
src/Discord.Net.Commands/CommandParameter.cs View File

@@ -1,4 +1,6 @@
using System.Diagnostics;
using System;
using System.Diagnostics;
using System.Reflection;
using System.Threading.Tasks;

namespace Discord.Commands
@@ -13,9 +15,10 @@ namespace Discord.Commands
public string Description { get; }
public bool IsOptional { get; }
public bool IsRemainder { get; }
public Type Type { get; }
internal object DefaultValue { get; }

public CommandParameter(string name, string description, TypeReader reader, bool isOptional, bool isRemainder, object defaultValue)
public CommandParameter(string name, string description, Type type, TypeReader reader, bool isOptional, bool isRemainder, object defaultValue)
{
_reader = reader;
Name = name;


Loading…
Cancel
Save