Message attachments

A message attachment lets us convey more content to the user, and lets it be displayed with more whistles and bells; but we have to keep an eye on a restriction imposed by Slack: no more than 20 attachments per message. It makes sense, otherwise our messages would be so messy that it would distract the average user.

What we have seen so far is a simple JSON: a one-level object, which is more or less like this example:

{    "text": "This is the first line of a messagen    This is the second line."}

In a message attachment, though we are going to see more details, more content modifier, and a flat structure like the one we just saw that has not enough complexity to convey all the information. We need structured container, still ...

Get Mastering Bash now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.