prefect_slack.messages
Tasks for sending Slack messages.
Functions
send_chat_message
channel: The name of the channel in which to post the chat message (e.g. #general).slack_credentials: Instance ofSlackCredentialsinitialized with a Slack bot token.text: Contents of the message. It’s a best practice to always provide atextargument when posting a message. Thetextargument is used in places where content cannot be rendered such as: system push notifications, assistive technology such as screen readers, etc.attachments: List of objects defining secondary context in the posted Slack message. The Slack API docs provide guidance on building attachments.slack_blocks: List of objects defining the layout and formatting of the posted message. The Slack API docs provide guidance on building messages with blocks.
- Response from the Slack API. Example response structures can be found in the Slack API docs.
send_incoming_webhook_message
slack_webhook: Instance ofSlackWebhookinitialized with a Slack webhook URL.text: Contents of the message. It’s a best practice to always provide atextargument when posting a message. Thetextargument is used in places where content cannot be rendered such as: system push notifications, assistive technology such as screen readers, etc.attachments: List of objects defining secondary context in the posted Slack message. The Slack API docs provide guidance on building attachments.slack_blocks: List of objects defining the layout and formatting of the posted message. The Slack API docs provide guidance on building messages with blocks.