Xpersona
P

Pywayne Lark Bot Listener

CLAWHUB · Unverified

Feishu/Lark message listener for real-time message processing via WebSocket. Use when users need to listen for incoming Feishu messages (text, image, file, p... Skill: Pywayne Lark Bot Listener Owner: wangyendt Summary: Feishu/Lark message listener for real-time message processing via WebSocket. Use when users need to listen for incoming Feishu messages (text, image, file, p... Tags: latest:0.1.0 Version history: v0.1.0 | 2026-02-16T08:23:34.770Z | auto Initial release of pywayne-lark-bot-listener. - Provides real-time Feishu/Lark message listening via WebSocket with async h

62
Rank
84
Safety
1.4k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1.4K downloads reported by the source. Last updated 10/10/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s172p3g61c0j9vy0sa1bs01b7x885y52:lark-bot-listener
  1. Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-wangyendt-lark-bot-listener/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

7,407 characters of source documentation, loaded on request.

Extracted files

3 files captured from the source.

SKILL.md

---
name: pywayne-lark-bot-listener
description: Feishu/Lark message listener for real-time message processing via WebSocket. Use when users need to listen for incoming Feishu messages (text, image, file, post) with automatic deduplication and async handling. Provides convenient decorators (text_handler, image_handler, file_handler) that handle message download/cleanup and optional automatic reply.
---

# Pywayne Lark Bot Listener

飞书消息监听器,通过 WebSocket 实时接收和处理飞书消息。

## Quick Start

```python
from pywayne.lark_bot_listener import LarkBotListener

# 初始化监听器
listener = LarkBotListener(
    app_id="your_app_id",
    app_secret="your_app_secret",
    message_expiry_time=60  # 消息去重过期时间(秒)
)

# 处理文本消息
@listener.text_handler()
async def handle_text(text: str):
    print(f"收到消息: {text}")

# 启动监听
listener.run()
```

## Decorators - 消息处理装饰器

### text_handler

文本消息处理装饰器,直接传递文本内容。

```python
@listener.text_handler(group_only=False, user_only=False)
async def handle_text(text: str, chat_id: str, is_group: bool, group_name: str, user_name: str):
    print(f"收到来自 {user_name} 的消息: {text}")
    listener.send_message(chat_id, f"已收到:{text}")
```

**参数说明**(除 `text` 外均为可选):

| 参数 | 类型 | 说明 |
|------|------|------|
| `text` | str | 文本内容(必需) |
| `chat_id` | str | 会话 ID |
| `is_group` | bool | 是否群组消息 |
| `group_name` | str | 群组名称(私聊时为空) |
| `user_name` | str | 发送消息的用户姓名 |

**装饰器参数**:
- `group_only=True`: 只处理群组消息
- `user_only=True`: 只处理私聊消息

### image_handler

图片消息处理装饰器,自动下载图片到临时文件并清理。

```python
from pathlib import Path
import cv2
import tempfile

@listener.image_handler()
async def handle_image(image_path: Path, user_name: str) -> Path:
    # 处理图片
    img = cv2.imread(str(image_path))
    # ...处理逻辑...
    # 返回新图片路径会自动发送回去,返回 None 则不发送
    return image_path
```

**参数说明**(除 `image_path` 外均为可选):

| 参数 | 类型 | 说明 |
|------|------|------|
| `image_path` | Path | 临时图片文件路径(必需) |
| `chat_id` | str | 会话 ID |
| `is_group` | bool | 是否群组消息 |
| `group_name` | str | 群组名称 |
| `user_name` | str | 发送消息的用户姓名 |

**返回值**:
- 返回 `Path`: 自动上传并发送新图片
- 返回 `None`: 不发送任何图片

### file_handler

文件消息处理装饰器,自动下载文件到临时文件并清理。

```python
@listener.file_handler()
async def handle_file(file_path: Path, user_name: str) -> Path:
    # 处理文件
    with open(file_path, 'r') as f:
        content = f.read()
    # ...处理逻辑...
    return file_path  # 返回文件路径会自动发送回去
```

**参数说明**(除 `file_path` 外均为可选):

| 参数 | 类型 | 说明 |
|------|------|------|
| `file_path` | Path | 临时文件路径(必需) |
| `chat_id` | str | 会话 ID |
| `is_group` | bool | 是否群组消息 |
| `group_name` | str | 群组名称 |
| `user_name` | str | 发送消息的用户姓名 |

## listen - 通用消息监听器

用于监听任意类型消息(包括富文本 post)。

```python
@listener.listen(message_type="post")
async def handle_post(ctx: MessageContext):
    print(f"收到富文本消息: {ctx.content}")
```

**MessageContext 属性**:

| 属性 | 类型 | 说明 |
|------|------|------|
| `chat_id` | str | 会话 ID |
| `user_id` | str | 用户 ID |
| `message_type` | str | 消息类型 |
| `content` | str | 消息内容(文本消息为字符串,其他类型为 JSON 字符串) |
| `is_group` | bool | 是否群组消息 |
| `chat_type` | s

_meta.json

{
  "ownerId": "kn7d2b8vpaw5d7bq2ybbb9sqjh8143nf",
  "slug": "lark-bot-listener",
  "version": "0.1.0",
  "publishedAt": 1771230214770
}

skill-card.md

## Description:

Feishu/Lark message listener for real-time WebSocket message processing with async handlers, message deduplication, attachment cleanup, and optional replies.

This skill is ready for commercial/non-commercial use.

## Publisher:

[wangyendt](https://clawhub.ai/user/wangyendt)

### License/Terms of Use:


## Use Case:

Developers and engineers use this skill to build Feishu/Lark bot listeners that process text, image, file, and rich post messages in real time. It is suited for agents that need to provide integration guidance, Python handler examples, and safe handling notes for message and attachment workflows.

### Deployment Geography for Use:

Global

## Known Risks and Mitigations:

Risk: Bot credentials and incoming Feishu/Lark messages or attachments may be sensitive.

Mitigation: Keep app_id and app_secret out of source control, grant only required bot permissions, and treat incoming content as sensitive.

Risk: Handlers that automatically reply or re-send files can expose processed content to unintended chats.

Mitigation: Review handler code and chat routing before enabling automatic replies or file sends.

## Reference(s):

- [ClawHub skill page](https://clawhub.ai/wangyendt/skills/lark-bot-listener)

## Skill Output:

**Output Type(s):** [text, markdown, code, configuration, guidance]

**Output Format:** [Markdown with Python code examples and configuration guidance]

**Output Parameters:** [1D]

**Other Properties Related to Output:** [May include guidance for app credentials, async handlers, message filtering, temporary file handling, and automatic replies.]

## Skill Version(s):

0.1.0 (source: release evidence)

## Ethical Considerations:

Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.

Sponsored

Ads related to Pywayne Lark Bot Listener and adjacent AI workflows.