Feishu bot
Feishu(Lark)는 기업용 메시징 및 협업 플랫폼입니다. 이 플러그인은 플랫폼의 WebSocket event subscription을 사용해 공개 webhook URL을 노출하지 않고도 OpenClaw가 Feishu/Lark bot 메시지를 수신하도록 연결합니다.Bundled plugin
Feishu는 현재 OpenClaw 릴리스에 기본 포함되므로 별도 plugin 설치가 필요하지 않습니다. 현재 번들되지 않은 구버전 빌드나 커스텀 설치를 사용 중이라면 수동으로 설치하세요.Quickstart
Feishu 채널을 추가하는 방법은 두 가지입니다.Method 1: onboarding wizard (recommended)
OpenClaw를 방금 설치했다면 wizard를 실행하세요.- Feishu 앱 생성 및 credentials 수집
- OpenClaw에 app credentials 구성
- gateway 시작
openclaw gateway statusopenclaw logs --follow
Method 2: CLI setup
초기 설치를 이미 마쳤다면 CLI로 채널을 추가할 수 있습니다.openclaw gateway statusopenclaw gateway restartopenclaw logs --follow
Step 1: Create a Feishu app
1. Open Feishu Open Platform
Feishu Open Platform에 접속해 로그인합니다. Lark(global) tenant는 https://open.larksuite.com/app을 사용하고, Feishu config에서domain: "lark"를 설정해야 합니다.
2. Create an app
- Create enterprise app를 클릭합니다.
- 앱 이름과 설명을 입력합니다.
- 앱 아이콘을 선택합니다.
3. Copy credentials
Credentials & Basic Info에서 다음 값을 복사합니다.- App ID (형식:
cli_xxx) - App Secret
4. Configure permissions
Permissions에서 Batch import를 클릭한 뒤 아래 JSON을 붙여넣습니다.
5. Enable bot capability
App Capability > Bot에서 다음을 수행합니다.- bot capability 활성화
- bot 이름 설정
6. Configure event subscription
중요: event subscription을 설정하기 전에 다음 조건을 만족해야 합니다.- Feishu용
openclaw channels add를 이미 실행함 - gateway가 실행 중임 (
openclaw gateway status)
- Use long connection to receive events (WebSocket)를 선택합니다.
im.message.receive_v1이벤트를 추가합니다.
7. Publish the app
- Version Management & Release에서 버전을 생성합니다.
- 리뷰 제출 후 publish합니다.
- 관리자 승인을 기다립니다. 엔터프라이즈 앱은 자동 승인되는 경우가 많습니다.
Step 2: Configure OpenClaw
Configure with the wizard (recommended)
Configure via config file
~/.openclaw/openclaw.json을 수정합니다.
connectionMode: "webhook"를 사용할 경우 verificationToken도 설정해야 합니다. Feishu webhook server는 기본적으로 127.0.0.1에 bind되므로, 의도적으로 바인드 주소를 바꾸는 경우에만 webhookHost를 지정하세요.
Verification Token (webhook mode)
webhook mode를 사용할 때는 config에channels.feishu.verificationToken을 설정해야 합니다. 값은 다음 위치에서 가져올 수 있습니다.
- Feishu Open Platform에서 앱을 엽니다.
- Development → Events & Callbacks로 이동합니다.
- Encryption 탭을 엽니다.
- Verification Token을 복사합니다.
Configure via environment variables
Lark (global) domain
tenant가 Lark(international)에 있다면 domain을lark로 설정하세요. channels.feishu.domain 또는 계정별 channels.feishu.accounts.<id>.domain에 지정할 수 있습니다.
Quota optimization flags
Feishu API 사용량을 줄이려면 두 가지 선택 플래그를 사용할 수 있습니다.typingIndicator(defaulttrue):false이면 typing reaction 호출을 건너뜁니다.resolveSenderNames(defaulttrue):false이면 발신자 profile lookup을 건너뜁니다.
Step 3: Start + test
1. Start the gateway
2. Send a test message
Feishu에서 bot을 찾아 테스트 메시지를 보냅니다.3. Approve pairing
기본값에서는 bot이 pairing code를 반환합니다. 아래 명령으로 승인하세요.Overview
- Feishu bot channel: gateway가 관리하는 Feishu bot 채널
- Deterministic routing: 응답은 항상 Feishu로 다시 전달됨
- Session isolation: DM은 main session을 공유하고, 그룹은 별도로 격리됨
- WebSocket connection: Feishu SDK의 long connection 사용, 공개 URL 불필요
Access control
Direct messages
-
기본값:
dmPolicy: "pairing". 알 수 없는 사용자는 pairing code를 받습니다. -
Approve pairing:
-
Allowlist mode: 허용할 Open ID를
channels.feishu.allowFrom에 설정합니다.
Group chats
1. Group policy (channels.feishu.groupPolicy)
"open"= 그룹에서 모두 허용 (default)"allowlist"=groupAllowFrom에 포함된 그룹만 허용"disabled"= 그룹 메시지 비활성화
channels.feishu.groups.<chat_id>.requireMention)
true=@mention이 있어야 응답 (default)false= mention 없이 응답
Group configuration examples
Allow all groups, require @mention (default)
Allow all groups, no @mention required
Allow specific groups only
Restrict which senders can message in a group (sender allowlist)
그룹 자체를 허용하는 것과 별개로, 해당 그룹의 모든 메시지는 senderopen_id 기준으로도 검증됩니다. groups.<chat_id>.allowFrom에 포함된 사용자만 메시지가 처리되며, 나머지 멤버의 메시지는 무시됩니다. 이는 /reset이나 /new 같은 control command에만 적용되는 제한이 아니라 전체 메시지 처리 게이트입니다.
Get group/user IDs
Group IDs (chat_id)
그룹 ID는oc_xxx 형식입니다.
Method 1 (recommended)
- gateway를 시작하고 그룹에서 bot을
@mention합니다. openclaw logs --follow를 실행하고chat_id를 찾습니다.
User IDs (open_id)
사용자 ID는ou_xxx 형식입니다.
Method 1 (recommended)
- gateway를 시작하고 bot에 DM을 보냅니다.
openclaw logs --follow를 실행하고open_id를 찾습니다.
Common commands
| Command | Description |
|---|---|
/status | Bot 상태 표시 |
/reset | 세션 초기화 |
/model | 모델 보기/전환 |
참고: Feishu는 아직 native command menu를 지원하지 않으므로 명령은 텍스트로 직접 전송해야 합니다.
Gateway management commands
| Command | Description |
|---|---|
openclaw gateway status | gateway 상태 표시 |
openclaw gateway install | gateway service 설치/시작 |
openclaw gateway stop | gateway service 중지 |
openclaw gateway restart | gateway service 재시작 |
openclaw logs --follow | gateway 로그 실시간 확인 |
Troubleshooting
Bot does not respond in group chats
- bot이 그룹에 추가되어 있는지 확인합니다.
- 기본 동작대로
@mention했는지 확인합니다. groupPolicy가"disabled"로 설정되지 않았는지 확인합니다.openclaw logs --follow로 로그를 확인합니다.
Bot does not receive messages
- 앱이 publish 및 승인되었는지 확인합니다.
- event subscription에
im.message.receive_v1이 포함되어 있는지 확인합니다. - long connection이 활성화되어 있는지 확인합니다.
- 앱 권한이 빠짐없이 설정되었는지 확인합니다.
- gateway가 실행 중인지 확인합니다:
openclaw gateway status openclaw logs --follow로 로그를 확인합니다.
App Secret leak
- Feishu Open Platform에서 App Secret을 재발급합니다.
- config의 App Secret을 갱신합니다.
- gateway를 재시작합니다.
Message send failures
- 앱에
im:message:send_as_bot권한이 있는지 확인합니다. - 앱이 publish되었는지 확인합니다.
- 로그에서 상세 오류를 확인합니다.
Advanced configuration
Multiple accounts
defaultAccount는 outbound API가 accountId를 명시하지 않을 때 어떤 Feishu account를 사용할지 결정합니다.
Message limits
textChunkLimit: outbound text chunk size (default:2000chars)mediaMaxMb: media upload/download limit (default:30MB)
Streaming
Feishu는 interactive cards를 사용한 streaming replies를 지원합니다. 활성화되면 bot은 텍스트를 생성하는 동안 카드를 계속 업데이트합니다.streaming: false로 설정합니다.
Multi-agent routing
bindings를 사용하면 Feishu DM이나 group을 서로 다른 agent로 라우팅할 수 있습니다.
match.channel:"feishu"match.peer.kind:"direct"또는"group"match.peer.id: user Open ID (ou_xxx) 또는 group ID (oc_xxx)
Configuration reference
전체 설정은 Gateway configuration을 참고하세요. 주요 옵션:| Setting | Description | Default |
|---|---|---|
channels.feishu.enabled | 채널 활성화 여부 | true |
channels.feishu.domain | API domain (feishu 또는 lark) | feishu |
channels.feishu.connectionMode | event transport mode | websocket |
channels.feishu.defaultAccount | outbound routing 기본 account ID | default |
channels.feishu.verificationToken | webhook mode에 필요 | - |
channels.feishu.webhookPath | webhook route path | /feishu/events |
channels.feishu.webhookHost | webhook bind host | 127.0.0.1 |
channels.feishu.webhookPort | webhook bind port | 3000 |
channels.feishu.accounts.<id>.appId | App ID | - |
channels.feishu.accounts.<id>.appSecret | App Secret | - |
channels.feishu.accounts.<id>.domain | account별 API domain override | feishu |
channels.feishu.dmPolicy | DM policy | pairing |
channels.feishu.allowFrom | DM allowlist (open_id list) | - |
channels.feishu.groupPolicy | Group policy | open |
channels.feishu.groupAllowFrom | Group allowlist | - |
channels.feishu.groups.<chat_id>.requireMention | @mention 필요 여부 | true |
channels.feishu.groups.<chat_id>.enabled | 그룹 활성화 여부 | true |
channels.feishu.textChunkLimit | 메시지 chunk 크기 | 2000 |
channels.feishu.mediaMaxMb | media 크기 제한 | 30 |
channels.feishu.streaming | streaming card output 활성화 | true |
channels.feishu.blockStreaming | block streaming 활성화 | true |
dmPolicy reference
| Value | Behavior |
|---|---|
"pairing" | 기본값. 알 수 없는 사용자는 pairing code를 받고 승인이 필요함 |
"allowlist" | allowFrom에 있는 사용자만 대화 가능 |
"open" | 모든 사용자 허용 (allowFrom에 "*" 필요) |
"disabled" | DM 비활성화 |
Supported message types
Receive
- ✅ Text
- ✅ Rich text (post)
- ✅ Images
- ✅ Files
- ✅ Audio
- ✅ Video
- ✅ Stickers
Send
- ✅ Text
- ✅ Images
- ✅ Files
- ✅ Audio
- ⚠️ Rich text (partial support)