如何使用松弛斜杠命令启动模式

时间:2019-12-14 14:16:09

标签: slack slack-api slack-commands

只是想知道如何使用slash命令启动松弛模态。

此模块套件出现此错误。

        {
            "type": "modal",
            "title": {
                "type": "plain_text",
                "text": "My App",
                "emoji": true
            },
            "submit": {
                "type": "plain_text",
                "text": "Submit",
                "emoji": true
            },
            "close": {
                "type": "plain_text",
                "text": "Cancel",
                "emoji": true
            },
            "blocks": [{
                "type": "section",
                "text": {
                    "type": "mrkdwn",
                    "text": "This block has an overflow menu."
                },
                "accessory": {
                    "type": "overflow",
                    "options": [{
                        "text": {
                            "type": "plain_text",
                            "text": "Option 1",
                            "emoji": true
                        },
                        "value": "value-0"
                    }, {
                        "text": {
                            "type": "plain_text",
                            "text": "Option 2",
                            "emoji": true
                        },
                        "value": "value-1"
                    }, {
                        "text": {
                            "type": "plain_text",
                            "text": "Option 3",
                            "emoji": true
                        },
                        "value": "value-2"
                    }, {
                        "text": {
                            "type": "plain_text",
                            "text": "Option 4",
                            "emoji": true
                        },
                        "value": "value-3"
                    }]
                }
            }, {
                "type": "section",
                "text": {
                    "type": "mrkdwn",
                    "text": "Pick a date for the deadline."
                },
                "accessory": {
                    "type": "datepicker",
                    "initial_date": "1990-04-28",
                    "placeholder": {
                        "type": "plain_text",
                        "text": "Select a date",
                        "emoji": true
                    }
                }
            }, {
                "type": "section",
                "fields": [{
                    "type": "plain_text",
                    "text": "*this is plain_text text*",
                    "emoji": true
                }, {
                    "type": "plain_text",
                    "text": "*this is plain_text text*",
                    "emoji": true
                }, {
                    "type": "plain_text",
                    "text": "*this is plain_text text*",
                    "emoji": true
                }, {
                    "type": "plain_text",
                    "text": "*this is plain_text text*",
                    "emoji": true
                }, {
                    "type": "plain_text",
                    "text": "*this is plain_text text*",
                    "emoji": true
                }]
            }, {
                "type": "section",
                "text": {
                    "type": "mrkdwn",
                    "text": "Pick one or more items from the list"
                },
                "accessory": {
                    "type": "multi_static_select",
                    "placeholder": {
                        "type": "plain_text",
                        "text": "Select items",
                        "emoji": true
                    },
                    "options": [{
                        "text": {
                            "type": "plain_text",
                            "text": "Choice 1",
                            "emoji": true
                        },
                        "value": "value-0"
                    }, {
                        "text": {
                            "type": "plain_text",
                            "text": "Choice 2",
                            "emoji": true
                        },
                        "value": "value-1"
                    }, {
                        "text": {
                            "type": "plain_text",
                            "text": "Choice 3",
                            "emoji": true
                        },
                        "value": "value-2"
                    }]
                }
            }, {
                "type": "input",
                "element": {
                    "type": "plain_text_input"
                },
                "label": {
                    "type": "plain_text",
                    "text": "Label",
                    "emoji": true
                }
            }, {
                "type": "input",
                "element": {
                    "type": "plain_text_input"
                },
                "label": {
                    "type": "plain_text",
                    "text": "Label",
                    "emoji": true
                }
            }]
        }

这是我通过斜杠命令调用时遇到的错误。

failed with the error "invalid_blocks"

只是想知道从slash命令调用模态的正确用法是什么。

谢谢。

0 个答案:

没有答案