Class EventMiddleware

Represents an event middleware

Constructors

Properties

Constructors

  • Creates a new event middleware

    Parameters

    Returns EventMiddleware

    Example

    // This means that the event will only be triggered if the client is ready
    const IsClientReady = new EventMiddleware(
    (client) => client.isReady(),
    (client) => console.log('Event not called since client is not ready')
    );

    module.exports.default = new Event({
    // ...
    middlewares: [IsClientReady]
    }, (...) => { ... });

Properties

failCallback?: EventCallback

The callback to call if the predicate fails

The predicate of the middleware

Generated using TypeDoc