Message formats

List of available message formats in Slack channel


Slack has partial markdown support in text components.

say "His palms are sweaty, knees weak, arms are heavy"
say Text("There's vomit on his sweater already, mom's spaghetti")
say "He's _nervous_, but **on the surface** he looks ~calm and ready~"

Typing, Wait

In Slack, Wait and Typing have the same behavior. No typing indicator exists in slack, so the bot will simply wait for the duration given (in milliseconds).

say Typing(1000)
say Wait(1000)

Question, Button

Slack makes it possible to style your buttons and define a custom payload that is sent to the chatbot on click. Available styles are "danger" and "primary". Slacks recommends to only use primary on one button in a list, and danger even less often.

say Question(
"Hi! My name is:",
Button("What?", payload="btn1"),
Button("Who?", payload="btn2", style="danger"),
Button("Slim Shady", payload="btn3", style="primary"),
say "User selected: {{event}}"
Before selecting an option

CSML Studio will also take advantage of Slack's features to update the content of the component when an option is chosen, so that the user's choice appears clearly after they select an option.

After selecting the option "Slim Shady"


Send the URL of an image. Slack will attempt to display it.

say Image("")

Video, Audio, Url

Generic files will render as standard URLs. When it can, Slack will try to display the URL nicely, such as the Wikipedia link below.

say Video("")
say Audio("")
say Url("")

Carousel, Card

A Carousel is essentially a collection of Card elements A single Card will display as a Carousel of 1 element.

do card1 = Card(
"The Marshall Mathers LP",
subtitle="Release date: May 23, 2000",
Button("Listen to this album", payload="marshallmatherslp1"),
Url("", text="Visit"),
do card2 = Card(
"The Slim Shady LP",
subtitle="Release date: February 23, 1999",
Button("Listen to this album", payload="theslimshadylp"),
Url("", text="Visit"),
do card3 = Card(
"The Marshall Mathers LP 2",
subtitle="Release date: November 5, 2013",
Button("Listen to this album", payload="marshallmatherslp2"),
Url("", text="Visit"),
say Carousel(cards=[card1, card2, card3])

You can add several Button or Url buttons to your Card components.

Full reference

For a complete reference of all the code presented on this page, refer to the following gist: