pw.io.slack

pw.io.slack.send_alerts(alerts, slack_channel_id, slack_token)

sourceSends content of a given column to the Slack channel. Each row in a column is a distinct message in the Slack channel.

  • Parameters
    • alerts (ColumnReference) – ColumnReference with alerts to be sent.
    • slack_channel_id (str) – id of the channel to which alerts are to be sent.
    • slack_token (str) – token used for authenticating to Slack API.

Example:

import os
import pathway as pw
slack_channel_id = os.environ["SLACK_CHANNEL_ID"]
slack_token = os.environ["SLACK_TOKEN"]
t = pw.debug.table_from_markdown('''
alert
This_is_Slack_alert
''')
pw.io.slack.send_alerts(t.alert, slack_channel_id, slack_token)