Skip to main content

SlackActionMiddlewareArgs<Action>

type SlackActionMiddlewareArgs<Action> = object & Action extends Exclude<SlackAction, DialogSubmitAction> ? object : unknown;

Defined in: src/types/actions/index.ts:46

Arguments which listeners and middleware receive to process an action from Slack's Block Kit interactive components, message actions, dialogs, or legacy interactive messages.

The type parameter Action represents the entire JSON-encoded request body from Slack. The generic type BlockAction<ElementAction> can be used to create a type for this parameter based on an element's action type. In this case ElementAction must extend BasicElementAction.

Type Declaration

ack

ack: ActionAckFn<Action>;

action

action: Action extends BlockAction<infer ElementAction> ? ElementAction : Action extends InteractiveMessage<infer InteractiveAction> ? InteractiveAction : Action;

body

body: Action;

complete?

optional complete?: FunctionCompleteFn;

fail?

optional fail?: FunctionFailFn;

inputs?

optional inputs?: FunctionInputs;

payload

payload: Action extends BlockAction<infer ElementAction> ? ElementAction : Action extends InteractiveMessage<infer InteractiveAction> ? InteractiveAction : Action;

respond

respond: RespondFn;

Type Parameters

Action

Action extends SlackAction = SlackAction