Wolfringo Wolfringo
Wolfringo Wolfringo
Wolfringo (c) 2020 TehGM
DocFX, DiscordFX theme.
Search Results for

    Class PrivateOnlyAttribute

    Command requirement that checks if message is a private message.

    Inheritance
    System.Object
    System.Attribute
    CommandRequirementAttribute
    PrivateOnlyAttribute
    Implements
    ICommandRequirement
    Inherited Members
    CommandRequirementAttribute.ErrorMessage
    CommandRequirementAttribute.AbortOnFail
    CommandRequirementAttribute.SendMessageWhenSkipping
    CommandRequirementAttribute.SuccessResult
    CommandRequirementAttribute.FailureResult
    CommandRequirementAttribute.ResultFromBoolean(Boolean)
    Namespace: TehGM.Wolfringo.Commands
    Assembly: Wolfringo.Commands.dll
    Syntax
    public class PrivateOnlyAttribute : CommandRequirementAttribute, ICommandRequirement
    Remarks

    Default ErrorMessage for this requirement is "(n) This command can be used in PM only.".

    Constructors

    | Improve this Doc View Source

    PrivateOnlyAttribute()

    Creates a new PrivateOnly attribute instance.

    Declaration
    public PrivateOnlyAttribute()

    Methods

    | Improve this Doc View Source

    CheckAsync(ICommandContext, IServiceProvider, CancellationToken)

    Checks requirement.

    Declaration
    public override Task<ICommandResult> CheckAsync(ICommandContext context, IServiceProvider services, CancellationToken cancellationToken = default(CancellationToken))
    Parameters
    Type Name Description
    ICommandContext context

    Command to check the requirement for.

    System.IServiceProvider services

    Services that can be used during requirement checks.

    System.Threading.CancellationToken cancellationToken

    Token for cancelling the task.

    Returns
    Type Description
    System.Threading.Tasks.Task<ICommandResult>

    True if requirement was fullfilled; otherwise false.

    Overrides
    CommandRequirementAttribute.CheckAsync(ICommandContext, IServiceProvider, CancellationToken)

    Implements

    ICommandRequirement

    See Also

    GroupOnlyAttribute