SlackMessage#

class safir.slack.blockkit.SlackMessage(**data)#

Bases: BaseModel

Message to post to Slack.

The message attribute will be the initial part of the message.

All fields in fields will be shown below that message, formatted in two columns. Order of fields is preserved; they will be laid out left to right and then top to bottom in the order given. Then, blocks will be added, if any, in one column below the fields. Finally, attachments will be added to the end as attachments, which get somewhat different formatting (for example, long attachments are collapsed by default).

At most ten elements are allowed in fields. They should be used for short information, generally a single half-line at most. Longer information should go into blocks or attachments.

Parameters:

data (Any) –

Methods Summary

to_slack()

Convert to a Slack Block Kit message.

Methods Documentation

to_slack()#

Convert to a Slack Block Kit message.

Returns:

A Slack Block Kit data structure suitable for serializing to JSON and sending to Slack.

Return type:

dict