Description
Hi team, currently there is no filter
field in the multi_conversation_select
block element type like below:
Lines 270 to 283 in b4b5a64
At the moment, only the conversation_select
which has the filter
object. In the slack documentation, it said the filter
object also supported in the multi_conversation_select
.
- https://api.slack.com/reference/block-kit/block-elements#conversation_multi_select
- https://api.slack.com/reference/block-kit/composition-objects#filter_conversations
As a workaround to bypass this issue, i create a conversation_select
block element, and change the element type once it created to be multi_conversation_select
, like:
var modal slack.ModalViewRequest
// omitted code to parsed/unmarshal the json kit to be the the view struct
// ...
block := modal.Blocks.BlockSet[0].(*slack.SectionBlock)
block.Accessory.SelectElement.Type = "multi_conversations_select"
modal.Blocks.BlockSet[0] = block
Example json kit template used
{
"type": "modal",
"title": {
"type": "plain_text",
"text": "Add to Channel",
"emoji": true
},
"submit": {
"type": "plain_text",
"text": "Add",
"emoji": true
},
"close": {
"type": "plain_text",
"text": "Close",
"emoji": true
},
"blocks": [
{
"type": "section",
"block_id": "block_add_to_channel",
"text": {
"type": "mrkdwn",
"text": "*Add these people to {{.ChannelName}}*"
},
"accessory": {
"action_id": "action_add_to_channel",
"type": "conversations_select",
"placeholder": {
"type": "plain_text",
"text": "Add people and/or channels"
},
"filter": {
"include": [
"im",
"public"
],
"exclude_bot_users": true
}
}
}
]
}
But i think that way is not clean, since we actually can directly create the multi_conversation_select
with filter
object based on the slack documentation.
I create my own pull request in #1191, please help to review and merge / please help to fix that issue if my PR is not suitable.
Thank you!