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:
committed by
RogueException
parent
394e0aa4d1
commit
b96748f9c3
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user