1

我用输入(multi_users_select)类型的um字段实现了一个松弛机器人。我想从列表选择中删除默认应用程序?

{
            type: 'input',
            element: {
                type: 'multi_users_select',
                action_id: input.actionId,
                initial_users: input.initial_users,
            },
            label: {
                type: 'plain_text',
                text: input.text,
                emoji: input.emoji,
            },
        };

在此处输入图像描述

4

2 回答 2

3

而不是type: 'multi_users_select'使用如下所示"type": "multi_conversations_select"过滤器来仅获取工作区中的用户。您可以将以下代码复制并粘贴到 block-kit builder 中以自行测试。 https://app.slack.com/block-kit-builder/

{
    "title": {
        "type": "plain_text",
        "text": "Blocker-Bot"
    },
    "submit": {
        "type": "plain_text",
        "text": "Submit"
    },
    "type": "modal",
    "callback_id": "custom_time_select",
    "private_metadata": "private-data",
    "blocks": [
        {
            "type": "section",
            "text": {
                "type": "mrkdwn",
                "text": "Test block with multi conversations select"
            },
            "accessory": {
                "type": "multi_conversations_select",
                "placeholder": {
                    "type": "plain_text",
                    "text": "Select conversations",
                    "emoji": true
                },
                "filter": {
                    "include": [
                        "im"
                    ],
                    "exclude_bot_users": true
                },
                "action_id": "multi_conversations_select-action"
            }
        }
    ]
}

21 年 7 月 5 日更新

包括没有机器人/应用程序的各种其他类型的精选用户

{
    "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": "Conversations type Select user"
            },
            "accessory": {
                "type": "conversations_select",
                "placeholder": {
                    "type": "plain_text",
                    "text": "Select a user",
                    "emoji": true
                },
                "filter": {
                    "include": [
                        "im"
                    ],
                    "exclude_bot_users": true
                },
                "action_id": "users_select-action"
            }
        },
        {
            "type": "section",
            "text": {
                "type": "mrkdwn",
                "text": "Multi Conversations type Select users"
            },
            "accessory": {
                "type": "multi_conversations_select",
                "placeholder": {
                    "type": "plain_text",
                    "text": "Select conversations",
                    "emoji": true
                },
                "filter": {
                    "include": [
                        "im"
                    ],
                    "exclude_bot_users": true
                },
                "action_id": "multi_conversations_select-action"
            }
        },
        {
            "type": "input",
            "element": {
                "type": "multi_conversations_select",
                "placeholder": {
                    "type": "plain_text",
                    "text": "Select users",
                    "emoji": true
                },
                "filter": {
                    "include": [
                        "im"
                    ],
                    "exclude_bot_users": true
                },
                "action_id": "multi_users_select-action"
            },
            "label": {
                "type": "plain_text",
                "text": "Input type Select users",
                "emoji": true
            }
        }
    ]
}
于 2021-07-02T11:04:11.140 回答
1

目前,过滤可用于对话选择菜单或对话多选菜单。 https://api.slack.com/reference/block-kit/composition-objects#filter_conversations

也许您可以写信给 feedback@slack.com,他们可以将其记录下来以备将来发布。

于 2021-06-25T20:01:44.733 回答