Add docstrings to preconditions.
This commit is contained in:
@@ -11,11 +11,27 @@ namespace Discord.Commands
|
||||
Group = 0x04
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Require that the command be invoked in a specified context.
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
|
||||
public class RequireContextAttribute : PreconditionAttribute
|
||||
{
|
||||
public ContextType Contexts { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Require that the command be invoked in a specified context.
|
||||
/// </summary>
|
||||
/// <param name="contexts">The type of context the command can be invoked in. Multiple contexts can be speicifed by ORing the contexts together.</param>
|
||||
/// <example>
|
||||
/// <code language="c#">
|
||||
/// [Command("private_only")]
|
||||
/// [RequireContext(ContextType.DM | ContextType.Group)]
|
||||
/// public async Task PrivateOnly()
|
||||
/// {
|
||||
/// }
|
||||
/// </code>
|
||||
/// </example>
|
||||
public RequireContextAttribute(ContextType contexts)
|
||||
{
|
||||
Contexts = contexts;
|
||||
|
||||
Reference in New Issue
Block a user