@@ -102,6 +102,41 @@ def handle_action_by_callback_id(payload):
102
102
log.debug(payload)
103
103
```
104
104
105
+ #### Interactive messages
106
+ Interactive message actions do not have an ` action_id ` . They do have a ` name ` and a ` type ` .
107
+ To act upon interactive messages, you can listen for the action type, ` interactive_message `
108
+ as wel as the combination of the ` interactive_message ` and ` name ` , ` type ` or both.
109
+ ``` python
110
+ import logging
111
+ from slackers.hooks import actions
112
+
113
+ log = logging.getLogger(__name__ )
114
+
115
+ # Listening for the action type.
116
+ @actions.on (" interactive_message" )
117
+ def handle_action (payload ):
118
+ log.info(" Action started." )
119
+ log.debug(payload)
120
+
121
+ # Listen for an action by it's name
122
+ @actions.on (" interactive_message:action_name" )
123
+ def handle_action_by_id (payload ):
124
+ log.info(" Action started." )
125
+ log.debug(payload)
126
+
127
+ # Listen for an action by it's type
128
+ @actions.on (" interactive_message:action_type" )
129
+ def handle_action_by_callback_id (payload ):
130
+ log.info(f " Action started. " )
131
+ log.debug(payload)
132
+
133
+ # Listen for an action by it's name and type
134
+ @actions.on (" interactive_message:action_name:action_type" )
135
+ def handle_action_by_callback_id (payload ):
136
+ log.info(f " Action started. " )
137
+ log.debug(payload)
138
+ ```
139
+
105
140
#### Custom responses
106
141
Slackers tries to be fast to respond to Slack. The events you are listening for with the
107
142
likes of ` @actions.on(...) ` are scheduled as an async task in a fire and forget fashion.
0 commit comments