Block Actions Interactions Payload Inquiry
See original GitHub issueHello,
I’m experimenting with the Slack Bolt Python API and its block actions interaction. In the function decorator, what is the value or string that the decorator should attempt to match?
@app.block_action("________")
Reproducible in:
The slack_bolt
version
slack-bolt==1.4.4
slack-sdk==3.4.2
slackclient==2.9.3
Python runtime version
Python 3.8.5
OS info
Nah
Steps to reproduce:
Source Code
app = AsyncApp(token="...")
blocks = [
{
"type": "actions",
"elements": [
{
"type": "button",
"text": {
"type": "plain_text",
"emoji": True,
"text": "Approve"
},
"style": "primary",
"value": "click_me_1"
},
{
"type": "button",
"text": {
"type": "plain_text",
"emoji": True,
"text": "Deny"
},
"style": "danger",
"value": "click_me_2"
}
]
}]
@app.event("app_mention")
async def app_mention(client, event, say):
channel = event['channel']
ts = event['ts']
await client.chat_postMessage(
channel=channel,
thread_ts=ts,
blocks=blocks
)
@app.block_action("________") <-- What should this decorator check for?
async def deny(ack, respond):
await ack()
await respond("Deny")
async def main():
handler = AsyncSocketModeHandler(app, "...")
await handler.start_async()
if __name__ == "__main__":
import asyncio
asyncio.run(main())
Expected result:
Slack Bolt API to register the listener and handle the block_action request via apt listener
Actual result:
Logs:
DEBUG:slack_bolt.AsyncApp:Checking listener: app_mention ...
DEBUG:slack_bolt.AsyncApp:Checking listener: deny ...
WARNING:slack_bolt.AsyncApp:Unhandled request ({'type': 'block_actions', ...
Requirements
Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.
Thanks all,
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
Reference: block_actions payloads - Slack API
A block_actions payload is received when a user interacts with a Block Kit interactive component. Read our guide to handling payloads from user...
Read more >Handling user interaction in your Slack apps
This payload is a bundle of information that explains the context of the user action, giving the app enough to construct a coherent...
Read more >Bolt Basics | Slack SDK for Java
Interactive Components: Responds to user actions (e.g., click a button, choose an item from select menus, radio buttons, etc.) in blocks. These events...
Read more >Messaging - Messenger Platform - Meta for Developers
Users have the option to block or mute a conversation with a business at any time. Here are examples of the user actions...
Read more >Customizing a User Interface using Block Kit - YouTube
Connect with Salesforce Developers:Website: https://developer.salesforce.com/Facebook: https://facebook.com/salesforcedevs/Twitter: ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@DataGreed If you don’t set action_id for a block element, a random value would be set. We highly recommend setting your own unique value for easily handling interactivity events.
The docs above really helped! Please feel free to close this issue 👍