Middlewares class abstract

Convenience methods for creating CommandMiddlewares.

Constructors

Middlewares()

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

onBeforeRun<O extends OptionDefinition, T>(FutureOr<void> onRun(CommandContext<O, T>)) → CommandMiddleware<O, T>
Creates a CommandMiddleware with a variant of onRun that does not return a value, intended for use before the command is run but no need to change the context.
onError<O extends OptionDefinition, T>(OnError<T?, CommandContext<O, T>> onError) → CommandMiddleware<O, T>
Creates a CommandMiddleware with the given onError hook.
onFinally<O extends OptionDefinition, T>(OnFinally<CommandContext<O, T>> onFinally) → CommandMiddleware<O, T>
Creates a CommandMiddleware with the given onFinally hook.
onReturn<O extends OptionDefinition, T>(OnReturn<T?, CommandContext<O, T>> onReturn) → CommandMiddleware<O, T>
Creates a CommandMiddleware with the given onReturn hook.
onRun<O extends OptionDefinition, T>(OnRun<CommandContext<O, T>> onRun) → CommandMiddleware<O, T>
Creates a CommandMiddleware with the given onRun hook.
withHooks<O extends OptionDefinition, T>({OnRun<CommandContext<O, T>>? onRun, OnReturn<T?, CommandContext<O, T>>? onReturn, OnError<T?, CommandContext<O, T>>? onError, OnFinally<CommandContext<O, T>>? onFinally}) → CommandMiddleware<O, T>
Factory function to create a CommandMiddleware with the given hooks.