Skip to content

cannot unmarshal object into Go struct field InteractionCallback.state of type string #816

@sambaiz

Description

@sambaiz

Following error occurred when handling block_actions callback.

cannot unmarshal object into Go struct field InteractionCallback.state of type string

The field is documented as dictionary of objects but the field of struct is string.

https://api.slack.com/reference/interaction-payloads/block-actions#reference-interactive-components-payloads__fields

state.values or view.state.values | A dictionary of objects keyed with the block_ids of all blocks containing stateful, interactive components .

{
    "type": "block_actions",
    ...
    "state": {
        "values": {
            "<block_id>": {
                "<action_id>": {
                    "type": "static_select",
                    "selected_option": {
                        "text": {
                            "type": "plain_text",
                            "text": "foo",
                            "emoji": true
                        },
                        "value": "foo"
                    }
                }
            }
        }
    },
    ...
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug[issue] bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions