Leonidas-from-XIV / slacko

A neat interface for Slack
https://leonidas-from-xiv.github.io/slacko
Other
81 stars 11 forks source link

Message text can be null #27

Closed paurkedal closed 6 years ago

paurkedal commented 6 years ago

I hit another undocumented detail of the Slack protocol: The "text" field of a message from the channels history can be null. Here is the (anonymised) entry:

{
  "ok": true,
  "latest": "1527804000",
  "oldest": "1527717600",
  "messages": [
    {
      "bot_id": "BXXXXXXXX",
      "attachments": [
        {
          "fallback": "<removed-link>: removed-text",
          "ts": 1527753303,
          "author_name": "removed",
          "author_link": "removed-link",
          "author_icon": "removed-link",
          "author_subname": "@removed",
          "pretext": "<removed-link>",
          "text": "removed-text",
          "service_name": "twitter",
          "service_url": "https://twitter.com/",
          "from_url": "removed-link",
          "image_url": "removed-link",
          "image_width": 999,
          "image_height": 999,
          "image_bytes": 99999,
          "id": 1,
          "footer": "Twitter",
          "footer_icon": "removed-link"
        }
      ],
      "text": null,
      "type": "message",
      "subtype": "bot_message",
      "ts": "1527753304.000028",
      "reactions": [
        {
          "name": "100",
          "users": [
            "UXXXXXXXX"
          ],
          "count": 1
        }
      ]
    }
  ],
  "has_more": false,
  "is_limited": true
}
paurkedal commented 6 years ago

That works, thanks!

Leonidas-from-XIV commented 6 years ago

Sure, let me know if you find any more discrepancies between this and Slack itself.