Skip to content

Table of Contents

slack

Slack Objects

class Slack()

The class includes all necessary methods to access the Slack endpoints

Arguments:

  • slack_api SlackAPI - Inject a Slack API model object that includes all necessary values and information
  • custom_notification bool - Specify if the custom notification should be enabled or not (default False)

Attributes:

  • slack_api SlackAPI - This is where we store the slack_api
  • custom_notification bool - This is where we store the custom_notification
  • slack_client httpx.Client - This is where we store the slack_client

send_slack_message

def send_slack_message(events_cw: list,
                       custom_successful_message: str = None,
                       custom_error_message: str = None)

The method includes a functionality to send the Slack messages

Arguments:

  • events_cw list - Specify the calendar events
  • custom_successful_message str - Specify the optional custom successful message (default None)
  • custom_error_message str - Specify the optional custom error message (default None)

Raises:

  • ConnectionError - It is not possible to establish a connection to the endpoint
  • ValueError - The return value of the Slack API call is not valid

Returns:

None