Listens for global or message shortcut invocation. Note that action elements included in an input block do not trigger any events. Note that a view can be a message, modal, or app home. The actionId identifier is a string that should match the unique action_id included when your app sends the element to a view. Listens for an action event from a Block Kit element, such as a user interaction with a button, select menu, or datepicker. The pattern parameter can be any substring ( string) or RegExp expression, which will be used to identify the incoming message. The eventType is a string to identify a specific event to handle (which must be subscribed to in your app’s configuration).Ĭonvenience method to listen specifically to the message event. The identifying parameter (included below) narrows the events to specific interactions that your listener function is intended to handle, such as a specific callback_id, or a certain substring within a message. These methods handle specific event types coming from Slack, and typically include an identifing parameter before the listener function. Methodsīelow is the current list of methods that accept listener functions.
For each type of incoming request from Slack, there are distinct methods that you can pass listener functions to handle and respond to the event. This can be something like listening to an Events API event (like when a link associated with your app is shared) or a user invoking one of your app’s shortcuts.
Slack apps typically receive and/or respond to one to many incoming events from Slack. It may be helpful to first go through the ⚡️ Getting Started guide to learn the basics of building Bolt for JavaScript apps. This guide is intended to detail the Bolt interface–including listeners and their arguments, initialization options, and errors.