Skip to content

Commit

Permalink
Fix seealso for preconditions and add missing descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
Still Hsu committed May 5, 2018
1 parent 3a7d7ee commit c2de0c0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
4 changes: 0 additions & 4 deletions docs/_overwrites/Commands/PreconditionAttribute.Overwrites.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
---
uid: Discord.Commands.PreconditionAttribute
seealso:
- linkId: Discord.Commands.ParameterPreconditionAttribute
remarks: *content
---

Expand All @@ -12,8 +10,6 @@ method-level for a command.

---
uid: Discord.Commands.ParameterPreconditionAttribute
seealso:
- linkId: Discord.Commands.PreconditionAttribute
remarks: *content
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ namespace Discord.Commands
/// <summary>
/// Requires the parameter to pass the specified precondition before execution can begin.
/// </summary>
/// <seealso cref="PreconditionAttribute"/>
[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = true, Inherited = true)]
public abstract class ParameterPreconditionAttribute : Attribute
{
Expand Down
13 changes: 11 additions & 2 deletions src/Discord.Net.Commands/Attributes/PreconditionAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@

namespace Discord.Commands
{
/// <summary> Requires the module or class to pass the specified precondition before execution can begin. </summary>
/// <summary>
/// Requires the module or class to pass the specified precondition before execution can begin.
/// </summary>
/// <seealso cref="ParameterPreconditionAttribute"/>
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, AllowMultiple = true, Inherited = true)]
public abstract class PreconditionAttribute : Attribute
{
/// <summary>
/// Specify a group that this precondition belongs to.
/// Specifies a group that this precondition belongs to.
/// </summary>
/// <remarks>
/// <see cref="Preconditions" /> of the same group require only one of the preconditions to pass in order to
Expand All @@ -17,6 +20,12 @@ public abstract class PreconditionAttribute : Attribute
/// </remarks>
public string Group { get; set; } = null;

/// <summary>
/// Checks if the <paramref name="command"/> has the sufficient permission to be executed.
/// </summary>
/// <param name="context">The context of the command.</param>
/// <param name="command">The command being executed.</param>
/// <param name="services">The service collection used for dependency injection.</param>
public abstract Task<PreconditionResult> CheckPermissionsAsync(ICommandContext context, CommandInfo command, IServiceProvider services);
}
}

0 comments on commit c2de0c0

Please sign in to comment.