F

interceptAction

Runs an interceptor before Discord handles each Flux action of one type. It may change the action, or drop it by returning true.

function interceptAction<K extends FluxActionType>(type: K, interceptor: FluxActionInterceptor<K>): () => void

Parameters

NameTypeDescription
typeK

The action type, like 'MESSAGE_CREATE'.

interceptorFluxActionInterceptor<K>

Runs with each action. An error it throws is logged and the action goes on.

Returns

() => void

A function that removes the interceptor.