slack-notify

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Slack Notify Skill

Slack Notify Skill

Send messages to Slack channels using incoming webhooks.
通过传入Webhook向Slack频道发送消息。

Setup

设置步骤

  1. In Slack, go to Channel Settings → Apps → Add an App → Search "Incoming Webhooks"
  2. Configure the webhook and copy the URL
  3. Set as GitHub secret:
    AGENT_LLM_SLACK_WEBHOOK_URL
  1. 在Slack中,进入频道设置 → 应用 → 添加应用 → 搜索“Incoming Webhooks”
  2. 配置Webhook并复制URL
  3. 将其设置为GitHub密钥:
    AGENT_LLM_SLACK_WEBHOOK_URL

Usage

使用方法

javascript
const { sendSlackMessage } = require('./index.js');

// Simple message
await sendSlackMessage('Hello from PopeBot!');

// Formatted message with blocks
await sendSlackMessage('Job Complete', {
  blocks: [
    {
      type: 'header',
      text: { type: 'plain_text', text: '🎉 Task Completed' }
    },
    {
      type: 'section',
      text: { type: 'mrkdwn', text: 'The job finished successfully in *5 minutes*.' }
    },
    {
      type: 'actions',
      elements: [
        {
          type: 'button',
          text: { type: 'plain_text', text: 'View Logs' },
          url: 'https://example.com/logs'
        }
      ]
    }
  ]
});

// Thread reply
await sendSlackMessage('Update on above', { thread_ts: '1234567890.123456' });
javascript
const { sendSlackMessage } = require('./index.js');

// 简单消息
await sendSlackMessage('Hello from PopeBot!');

// 带区块的格式化消息
await sendSlackMessage('Job Complete', {
  blocks: [
    {
      type: 'header',
      text: { type: 'plain_text', text: '🎉 Task Completed' }
    },
    {
      type: 'section',
      text: { type: 'mrkdwn', text: 'The job finished successfully in *5 minutes*.' }
    },
    {
      type: 'actions',
      elements: [
        {
          type: 'button',
          text: { type: 'plain_text', text: 'View Logs' },
          url: 'https://example.com/logs'
        }
      ]
    }
  ]
});

// 线程回复
await sendSlackMessage('Update on above', { thread_ts: '1234567890.123456' });

Features

功能特性

  • Plain text and formatted messages (mrkdwn)
  • Interactive blocks (buttons, selects, inputs)
  • Thread replies
  • User mentions (
    <@USER_ID>
    )
  • Channel mentions (
    #channel
    )
  • Attachments with colors
  • Custom icons and usernames
  • 纯文本和格式化消息(mrkdwn)
  • 交互式区块(按钮、选择器、输入框)
  • 线程回复
  • 用户提及(
    <@USER_ID>
  • 频道提及(
    #channel
  • 带颜色的附件
  • 自定义图标和用户名

Rate Limits

速率限制

Slack webhooks are rate limited. The skill includes automatic retry with exponential backoff.
Slack Webhook存在速率限制。本Skill包含自动重试功能,采用指数退避策略。