SlackMessenger
Ancestors
systematica.tools.messengers.base.BaseMessengerabc.ABCsystematica.generic.loggers.Logger
Instance variables
-
channel: str: The Slack channel to send messages to. Defaults to ‘#systematica-workflow’ -
logger: systematica.generic.loggers.Logger: Custom logger. -
slack_client: slack_sdk.web.client.WebClient: A WebClient allows apps to communicate with the Slack Platform Web API. The Slack Web API is an interface for querying information from and enacting change in a Slack workspace. -
template: str: Template name. -
token: str: Slack API token.
Methods
send
| Name | Type | Default | Description |
|---|---|---|---|
message | str | -- | The message to send. |
channel | str | None | The Slack channel to send messages to. If not None, overwrite the class level channel. Defaults to None. |
| Type | Description |
|---|---|
SlackApiError | If the Slack API returns an error while sending the message. |
upload
- Converts the figure to a PNG image in memory before uploading.
- Uses the Slack Web API to upload the file to the specified channel.
- Logs the success or failure of the upload operation.
| Name | Type | Default | Description |
|---|---|---|---|
fig | type | -- | The figure to upload. Typically a Plotly figure object. |
title | str | None | The title of the uploaded file, by default None. |
initial_comment | str | None | An initial comment to include with the uploaded file, by default None. |
width | int | 800 | The width of the figure in pixels, by default 800. |
height | int | 1000 | The height of the figure in pixels, by default 1000. |
channel | str | None | The Slack channel to send messages to. If not None, overwrite the class level channel. Defaults to None. |

