alpaca_daily_losers.slack

Classes

Slack

A class to send messages to a Slack channel.

Module Contents

class alpaca_daily_losers.slack.Slack(slack_token: str = None)

A class to send messages to a Slack channel.

slack_token

Token for authenticating with the Slack API.

Type:

str

client

Slack WebClient instance for making API calls.

Type:

WebClient

send_message(channel: str, text: str, username: str = None)

Sends a message to the specified Slack channel.

Parameters:
  • channel (str) – Slack channel ID or name.

  • text (str) – Message text to send.

  • username (str, optional) – Username to send the message as. Defaults to None.

Returns:

Response from the Slack API.

Return type:

dict

Raises:

ValueError – If the Slack token is not set or if the message fails to send.