6

I want to show "show more" in slack messages.

I use the slack web api to send messages. If the number of characters is long, I want to use the "show more" button.

What I've found so far is using the text field of secondary message attachments. But since this is legacy, they tell me to use the block kit, but I don't know how. (https://api.slack.com/reference/messaging/attachments)

Is there any way?

Ga.R
  • 65
  • 1
  • 5

2 Answers2

5

Using Block Kit, you aren't able to define where breaks/read more etc should occur. The theory is that you send the content as Blocks, and the Platform decides how best to render it for the device where it's viewed.

Colm Doyle
  • 3,598
  • 1
  • 20
  • 22
  • OMG.. It's not good to me.. :( Thank u for answering! – Ga.R Jun 03 '21 at 10:43
  • @Colm Doyle, I tried to send a big text and got "must be less than 3001 characters" error. Also I tried to put a big text with less characters and the Platform didn't add "Show more" or something. It would just show a huge text which is not ideal compared to attachements that would add "Show more" for anything even slightly big. Is there a good replacement or I should stick to attachments? – Ruslan Sep 22 '21 at 19:56
0

Instead of text fields you should send as attachments, then Slack should display a show more if there are too many attachments.

See more on https://api.slack.com/messaging/composing/layouts.

Note: Attachments is a legacy part of messaging functionality at Slack

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Sydney C.
  • 950
  • 10
  • 21