Skip to content

blocks の内容が取れていない #159

Open
@thinca

Description

@thinca

slack-go が用意している構造体が Slack API が返す構造とマッチしていないため、blocks の内容がほぼ丸ごと何も JSON として保存されていない。

最終的に正確にレンダリングするためには blocks の内容は必須

実際のレスポンス: (発言の内容は重要ではないので差し替えてあります)

{
  "client_msg_id": "45da996d-45af-4ea9-938e-31dc7ffc61f9",
  "type": "message",
  "text": "ほげ",
  "user": "U776661HA",
  "ts": "1594114388.335900",
  "team": "T03C4RC8V",
  "blocks": [
    {
      "type": "rich_text",
      "block_id": "0Rh",
      "elements": [
        {
          "type": "rich_text_section",
          "elements": [
            {
              "type": "text",
              "text": "ほげ"
            }
          ]
        }
      ]
    }
  ]
}

JSON として保存されたメッセージ

{
  "client_msg_id": "45da996d-45af-4ea9-938e-31dc7ffc61f9",
  "type": "message",
  "user": "U776661HA",
  "text": "ほげ",
  "ts": "1594114388.335900",
  "team": "T03C4RC8V",
  "replace_original": false,
  "delete_original": false,
  "blocks": [
    {
      "type": "rich_text",
      "block_id": "0Rh"
    }
  ],
  "source_team": "T03C4RC8V",
  "user_team": "T03C4RC8V"
}

elements 以下がゴソッとないです。構造体にもメンバーがないです。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions