Class Requirement

A requirement for a command to be executed.

Hierarchy

  • Requirement

Constructors

Properties

Methods

Constructors

Properties

handler: ((itr: Interaction<CacheType>) => Awaitable<boolean | Promise<boolean>>)

Type declaration

    • (itr: Interaction<CacheType>): Awaitable<boolean | Promise<boolean>>
    • The handler of the requirement.

      Parameters

      • itr: Interaction<CacheType>

      Returns Awaitable<boolean | Promise<boolean>>

name: string

The name of the requirement.

whenelse: ((itr: Interaction<CacheType>) => any)

Type declaration

    • (itr: Interaction<CacheType>): any
    • Called when return is false.

      Parameters

      • itr: Interaction<CacheType>

      Returns any

Methods

  • Checks if the requirement is met.

    Returns

    Whether the requirement is met.

    Parameters

    • itr: Interaction<CacheType>

      The interaction to check.

    Returns Promise<boolean>

  • Sets the handler of the requirement.

    Returns

    The requirement.

    Parameters

    • handler: ((itr: Interaction<CacheType>) => Awaitable<boolean | Promise<boolean>>)

      The handler of the requirement.

        • (itr: Interaction<CacheType>): Awaitable<boolean | Promise<boolean>>
        • Parameters

          • itr: Interaction<CacheType>

          Returns Awaitable<boolean | Promise<boolean>>

    • whenelse: ((itr: Interaction<CacheType>) => Awaitable<void | Promise<any>>)

      Called when return is false.

        • (itr: Interaction<CacheType>): Awaitable<void | Promise<any>>
        • Parameters

          • itr: Interaction<CacheType>

          Returns Awaitable<void | Promise<any>>

    Returns Requirement

Generated using TypeDoc