Skip to main content

SlackMessenger

A messenger class for sending messages to Slack. Method generated by attrs for class SlackMessenger.

Ancestors

  • systematica.tools.messengers.base.BaseMessenger
  • abc.ABC
  • systematica.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

Send a message to Slack and log it. Parameters: Raises:

upload

Upload a figure to Slack and log the operation:
  • 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.
Parameters: