slack#

Slack contrib functionality.

Function notify_slack#

notify_slack(title: str, content: str | dict[str, str], attachment_color: str = '#4bb543', short_threshold: int = 40, token: str | Path | None = None, channel: str | None = None, mention_user: str | None = None, **kwargs) bool[source]#

Sends a slack notification and returns True on success. The communication with the slack API might have some delays and is therefore handled by a thread. The format of the notification depends on content. If it is a string, a simple text notification is sent. Otherwise, it should be a dictionary whose fields are used to build a message attachment with two-column formatting.

Class NotifySlackParameter#

class NotifySlackParameter(*args, **kwargs)[source]#

Bases: NotifyParameter

get_transport() dict[str, Any][source]#

Method to configure the transport that is toggled by this parameter. Should return a dictionary with "func" and "raw" (optional) fields.