# Feishu Bot

## Overview

The Feishu plugin connects OpenClaw to Lark's team chat platform through WebSocket event subscriptions, eliminating the need for public webhook URLs.

## Installation

```bash
openclaw plugins install @openclaw/feishu
```

## Configuration Methods

- Onboarding wizard (recommended): `openclaw onboard`
- CLI: `openclaw channels add`
- Config file: Edit `~/.openclaw/openclaw.json`
- Environment variables: `FEISHU_APP_ID` and `FEISHU_APP_SECRET`

## Creating a Feishu App

1. Visit Feishu Open Platform and create an enterprise app
2. Collect App ID (format: `cli_xxx`) and App Secret from credentials section
3. Import required permissions via batch import JSON
4. Enable bot capability and set bot name
5. Configure event subscription using long connection (WebSocket) with `im.message.receive_v1`
6. Publish and await approval

**Important:** Before setting event subscription, make sure you already ran `openclaw channels add` for Feishu and the gateway is operational.

## Access Control

### Direct Messages

- Default pairing mode requires user approval via: `openclaw pairing approve feishu <CODE>`
- Alternative allowlist mode restricts to specified Open IDs

### Group Chats

- Policy options: `open` (default), `allowlist`, or `disabled`
- Per-group mention requirement configuration available

## Retrieving IDs

- Group IDs resemble `oc_xxx`
- User IDs resemble `ou_xxx`

Obtain these by starting the gateway, mentioning/messaging the bot, then checking logs via `openclaw logs --follow`.

## Supported Features

**Message Types Received:**
- Text
- Rich text
- Images
- Files
- Audio
- Video
- Stickers

**Message Types Sent:**
- Text
- Images
- Files
- Audio
- Partial rich text support

**Additional Capabilities:**
- Streaming replies
- Multi-agent routing
- Multiple account support
