1

I'm trying to send a bulleted list as a Slack message.

However this structure is pretty verbose (as explained in this answer) and for some reason I get an invalid_blocks error as a response.

RichTextBlock.builder()
    .elements(
        listOf(
            RichTextListElement.builder()
                .elements(
                    listOf(
                        RichTextSectionElement.builder()
                           .elements(listOf(SlackTextElement("test")))
                           .build()
                    )
                )
                .style("bullet")
                .indent(0)
                .build()
        )
    )
.build()

Where SlackTextElement is a (Java) class which I implemented, in order to match the example from the answer I mentioned above.

public class SlackTextElement implements RichTextElement {
    String text;
    String type = "text";

    public SlackTextElement(String text) {
        this.text = text;
    }

    @Override
    public String getType() {
        return type;
    }
}

Is there any way to achieve this? Alternatively, to debug Slack's API?

GalAbra
  • 5,048
  • 4
  • 23
  • 42

0 Answers0