搜索

PythonReactSEOPDF
OpenClaw

feishu-message-fallback

Feishu message fallback mechanism with retry logic. Automatically retries failed messages with exponential backoff and fallback from rich text to plain text.

24267580930 来源安装数☆ 0 仓库 Stars

安装与使用

请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。

SkillHub CLI

skillhub install 2426758093/feishu-message-fallback

打开来源仓库,查看说明和兼容环境后,按来源提供的命令或步骤安装。

将来源链接提供给你的 Agent,让它先读取说明、核对依赖,并向你说明将执行的安装步骤。

查看来源 ↗使用指南

技能说明

飞书消息回退机制

功能

  • 自动重试:消息发送失败时自动重试(最多 3 次)
  • 指数退避:重试间隔递增(1s → 2s → 4s)
  • 降级策略:富文本失败 → 纯文本重试
  • 错误日志:记录失败原因和重试结果

使用场景

  • 网络波动导致消息发送失败
  • 富文本格式不被支持
  • 消息队列积压

实现逻辑

# 伪代码
function Send-FeishuMessageWithFallback {
    param($message, $retryCount = 3)
    
    for ($i = 0; $i -lt $retryCount; $i++) {
        try {
            # 尝试发送富文本
            $result = Send-FeishuRichText -message $message
            if ($result.success) { return $result }
        } catch {
            Write-Host "Attempt $($i+1) failed: $_"
        }
        
        # 指数退避等待
        if ($i -lt $retryCount - 1) {
            $waitTime = [Math]::Pow(2, $i)
            Start-Sleep -Seconds $waitTime
        }
    }
    
    # 所有重试失败,降级为纯文本
    Write-Host "Rich text failed, falling back to plain text..."
    return Send-FeishuPlainText -message $message
}

配置

在 TOOLS.md 中添加:

### 飞书消息回退配置

- **最大重试次数:** 3
- **重试间隔:** 1s, 2s, 4s(指数退避)
- **降级策略:** 富文本 → 纯文本

错误处理

错误类型 处理方式
网络超时 自动重试
格式错误 降级为纯文本
权限不足 立即失败,通知用户
消息过长 截断后重试

集成到定时任务

定时任务调用时自动启用回退机制:

{
  "delivery": {
    "mode": "announce",
    "channel": "feishu",
    "to": "ou_faec8fadc584abfd18a2996f55d607b5",
    "retry": {
      "maxAttempts": 3,
      "backoffMs": 1000
    }
  }
}

来源信息

Source
github
Repository
openclaw/skills
Path
skills/2426758093/feishu-message-fallback
Version
—
Commit
e076db1feec6a49e39e24ddd953075815ec7b76f
分类来源
rules
状态
active
可见性
public

这些信息来自收录时的来源分析,可能滞后;使用前请核对最新来源文件。

来源内容

SKILL.md
# 飞书消息回退机制

## 功能

- **自动重试**:消息发送失败时自动重试(最多 3 次)
- **指数退避**:重试间隔递增(1s → 2s → 4s)
- **降级策略**:富文本失败 → 纯文本重试
- **错误日志**:记录失败原因和重试结果

## 使用场景

- 网络波动导致消息发送失败
- 富文本格式不被支持
- 消息队列积压

## 实现逻辑

```powershell
# 伪代码
function Send-FeishuMessageWithFallback {
    param($message, $retryCount = 3)
    
    for ($i = 0; $i -lt $retryCount; $i++) {
        try {
            # 尝试发送富文本
            $result = Send-FeishuRichText -message $message
            if ($result.success) { return $result }
        } catch {
            Write-Host "Attempt $($i+1) failed: $_"
        }
        
        # 指数退避等待
        if ($i -lt $retryCount - 1) {
            $waitTime = [Math]::Pow(2, $i)
            Start-Sleep -Seconds $waitTime
        }
    }
    
    # 所有重试失败,降级为纯文本
    Write-Host "Rich text failed, falling back to plain text..."
    return Send-FeishuPlainText -message $message
}
```

## 配置

在 `TOOLS.md` 中添加:

```markdown
### 飞书消息回退配置

- **最大重试次数:** 3
- **重试间隔:** 1s, 2s, 4s(指数退避)
- **降级策略:** 富文本 → 纯文本
```

## 错误处理

| 错误类型 | 处理方式 |
|---------|---------|
| 网络超时 | 自动重试 |
| 格式错误 | 降级为纯文本 |
| 权限不足 | 立即失败,通知用户 |
| 消息过长 | 截断后重试 |

## 集成到定时任务

定时任务调用时自动启用回退机制:

```json
{
  "delivery": {
    "mode": "announce",
    "channel": "feishu",
    "to": "ou_faec8fadc584abfd18a2996f55d607b5",
    "retry": {
      "maxAttempts": 3,
      "backoffMs": 1000
    }
  }
}
```

相关技能

OpenClaw

x402hub

capncoconut

Register, communicate, and earn on the x402hub AI agent marketplace. Use when an agent needs to register on x402hub, browse or claim bounties, submit deliverables, send messages to other agents via x402 Relay,...

OpenClaw

claw

capevace

Real-time event bus for AI agents. Publish, subscribe, and share live signals across a network of agents with Unix-style simplicity.

OpenClaw

captchas-openclaw

captchasco

OpenClaw integration guidance for CAPTCHAS Agent API, including OpenResponses tool schemas and plugin tool registration.