You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/_basic/listening_actions.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ order: 5
8
8
<divclass="section-content">
9
9
Your app can listen to user actions like button clicks, and menu selects, using the `action` method.
10
10
11
-
Actions can be filtered on an `action_id` of type `str` or `RegExp` object. `action_id`s act as unique identifiers for interactive components on the Slack platform.
11
+
Actions can be filtered on an `action_id` of type `str` or `re.Pattern`. `action_id`s act as unique identifiers for interactive components on the Slack platform.
12
12
13
13
You’ll notice in all `action()` examples, `ack()` is used. It is required to call the `ack()` function within an action listener to acknowledge that the event was received from Slack. This is discussed in the [acknowledging events section](#acknowledge).
14
14
@@ -29,18 +29,18 @@ def update_message(ack):
29
29
30
30
<divclass="secondary-content"markdown="0">
31
31
32
-
You can use a constraints object to listen to `callback_id`s, `block_id`s, and `action_id`s (or any combination of them). Constraints in the object can be of type `str` or `RegExp` object.
32
+
You can use a constraints object to listen to `callback_id`s, `block_id`s, and `action_id`s (or any combination of them). Constraints in the object can be of type `str` or `re.Pattern`.
33
33
34
34
</div>
35
35
36
36
```python
37
37
# Your function will only be called when the action_id matches 'select_user' AND the block_id matches 'assign_ticket'
Copy file name to clipboardExpand all lines: docs/_basic/listening_modals.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ order: 12
7
7
8
8
<divclass="section-content">
9
9
10
-
If a <ahref="https://api.slack.com/reference/block-kit/views">view payload</a> contains any input blocks, you must listen to `view_submission` events to receive their values. To listen to `view_submission` events, you can use the built-in `view()` method. `view()` requires a `callback_id` of type `str` or `RegExp`.
10
+
If a <ahref="https://api.slack.com/reference/block-kit/views">view payload</a> contains any input blocks, you must listen to `view_submission` events to receive their values. To listen to `view_submission` events, you can use the built-in `view()` method. `view()` requires a `callback_id` of type `str` or `re.Pattern`.
11
11
12
12
You can access the value of the `input` blocks by accessing the `state` object. `state` contains a `values` object that uses the `block_id` and unique `action_id` to store the input values.
Copy file name to clipboardExpand all lines: docs/_basic/listening_responding_shortcuts.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ order: 8
9
9
10
10
The `shortcut()` method supports both [global shortcuts](https://api.slack.com/interactivity/shortcuts/using#global_shortcuts) and [message shortcuts](https://api.slack.com/interactivity/shortcuts/using#message_shortcuts).
11
11
12
-
Shortcuts are invokable entry points to apps. Global shortcuts are available from within search in Slack. Message shortcuts are available in the context menus of messages. Your app can use the `shortcut()` method to listen to incoming shortcut events. The method requires a `callback_id` parameter of type `str` or `RegExp`.
12
+
Shortcuts are invokable entry points to apps. Global shortcuts are available from within search in Slack. Message shortcuts are available in the context menus of messages. Your app can use the `shortcut()` method to listen to incoming shortcut events. The method requires a `callback_id` parameter of type `str` or `re.Pattern`.
13
13
14
14
Shortcuts must be acknowledged with `ack()` to inform Slack that your app has received the event.
15
15
@@ -25,12 +25,12 @@ When configuring shortcuts within your app configuration, you'll continue to app
25
25
26
26
# The open_modal shortcut opens a plain old modal
27
27
@app.shortcut("open_modal")
28
-
defopen_modal(ack, client):
28
+
defopen_modal(ack, shortcut, client):
29
29
# Acknowledge the shortcut request
30
30
ack()
31
31
# Call the views_open method using one of the built-in WebClients
32
32
client.views_open(
33
-
trigger_id=payload["trigger_id"],
33
+
trigger_id=shortcut["trigger_id"],
34
34
view={
35
35
"type": "modal",
36
36
"title": {
@@ -69,19 +69,19 @@ def open_modal(ack, client):
69
69
</summary>
70
70
71
71
<divclass="secondary-content"markdown="0">
72
-
You can use a constraints object to listen to `callback_id`s, and `type`s. Constraints in the object can be of type `str` or `RegExp` object.
72
+
You can use a constraints object to listen to `callback_id`s, and `type`s. Constraints in the object can be of type `str` or `re.Pattern`.
73
73
</div>
74
74
75
75
```python
76
76
77
77
# Your middleware will only be called when the callback_id matches 'open_modal' AND the type matches 'message_action'
0 commit comments