Allow arbitrary attributes to be added to commands (#458)

* Allow arbitrary attributes to be added to commands

I still don't approve adding type info back into commands, so
I decided to use this solution for allowing arbitrary attributes to be
added to commands.

Add attributes property to ParameterBuilder

Add Attributes properties to info types

* Why on earth git

* Add using for system so that Attribute can be used
This commit is contained in:
Finite Reality
2017-06-29 22:30:26 +01:00
committed by RogueException
parent 394e0aa4d1
commit b96748f9c3
7 changed files with 56 additions and 2 deletions

View File

@@ -122,6 +122,9 @@ namespace Discord.Commands
case PreconditionAttribute precondition:
builder.AddPrecondition(precondition);
break;
default:
builder.AddAttributes(attribute);
break;
}
}
@@ -173,6 +176,9 @@ namespace Discord.Commands
case PreconditionAttribute precondition:
builder.AddPrecondition(precondition);
break;
default:
builder.AddAttributes(attribute);
break;
}
}
@@ -239,6 +245,9 @@ namespace Discord.Commands
builder.IsRemainder = true;
break;
default:
builder.AddAttributes(attribute);
break;
}
}
@@ -289,4 +298,4 @@ namespace Discord.Commands
!methodInfo.IsGenericMethod;
}
}
}
}