Skip to content

Commit ba0ef4b

Browse files
committed
Merge branch 'main' into architecture-32-bit
2 parents 2cb90f2 + 7d45101 commit ba0ef4b

13 files changed

Lines changed: 774 additions & 41 deletions

File tree

.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
# ── Chat Channel ──────────────────────────
1010
# TELEGRAM_BOT_TOKEN=123456:ABC...
1111
# DISCORD_BOT_TOKEN=xxx
12+
# LINE_CHANNEL_SECRET=xxx
13+
# LINE_CHANNEL_ACCESS_TOKEN=xxx
1214

1315
# ── Web Search (optional) ────────────────
1416
# BRAVE_SEARCH_API_KEY=BSA...

.github/workflows/build.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,10 @@ jobs:
1616
with:
1717
go-version-file: go.mod
1818

19+
- name: fmt
20+
run: |
21+
make fmt
22+
git diff --exit-code || (echo "::error::Code is not formatted. Run 'make fmt' and commit the changes." && exit 1)
23+
1924
- name: Build
2025
run: make build-all

README.ja.md

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,14 +223,15 @@ picoclaw agent -m "What is 2+2?"
223223

224224
## 💬 チャットアプリ
225225

226-
Telegram、Discord、QQ、DingTalk で PicoClaw と会話できます
226+
Telegram、Discord、QQ、DingTalk、LINE で PicoClaw と会話できます
227227

228228
| チャネル | セットアップ |
229229
|---------|------------|
230230
| **Telegram** | 簡単(トークンのみ) |
231231
| **Discord** | 簡単(Bot トークン + Intents) |
232232
| **QQ** | 簡単(AppID + AppSecret) |
233233
| **DingTalk** | 普通(アプリ認証情報) |
234+
| **LINE** | 普通(認証情報 + Webhook URL) |
234235

235236
<details>
236237
<summary><b>Telegram</b>(推奨)</summary>
@@ -376,6 +377,56 @@ picoclaw gateway
376377

377378
</details>
378379

380+
<details>
381+
<summary><b>LINE</b></summary>
382+
383+
**1. LINE 公式アカウントを作成**
384+
385+
- [LINE Developers Console](https://developers.line.biz/) にアクセス
386+
- プロバイダーを作成 → Messaging API チャネルを作成
387+
- **チャネルシークレット****チャネルアクセストークン** をコピー
388+
389+
**2. 設定**
390+
391+
```json
392+
{
393+
"channels": {
394+
"line": {
395+
"enabled": true,
396+
"channel_secret": "YOUR_CHANNEL_SECRET",
397+
"channel_access_token": "YOUR_CHANNEL_ACCESS_TOKEN",
398+
"webhook_host": "0.0.0.0",
399+
"webhook_port": 18791,
400+
"webhook_path": "/webhook/line",
401+
"allow_from": []
402+
}
403+
}
404+
}
405+
```
406+
407+
**3. Webhook URL を設定**
408+
409+
LINE の Webhook には HTTPS が必要です。リバースプロキシまたはトンネルを使用してください:
410+
411+
```bash
412+
# ngrok の例
413+
ngrok http 18791
414+
```
415+
416+
LINE Developers Console で Webhook URL を `https://あなたのドメイン/webhook/line` に設定し、**Webhook の利用** を有効にしてください。
417+
418+
**4. 起動**
419+
420+
```bash
421+
picoclaw gateway
422+
```
423+
424+
> グループチャットでは @メンション時のみ応答します。返信は元メッセージを引用する形式です。
425+
426+
> **Docker Compose**: `picoclaw-gateway` サービスに `ports: ["18791:18791"]` を追加して Webhook ポートを公開してください。
427+
428+
</details>
429+
379430
## ⚙️ 設定
380431

381432
設定ファイル: `~/.picoclaw/config.json`

README.md

Lines changed: 58 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -242,14 +242,15 @@ That's it! You have a working AI assistant in 2 minutes.
242242

243243
## 💬 Chat Apps
244244

245-
Talk to your picoclaw through Telegram, Discord, or DingTalk
245+
Talk to your picoclaw through Telegram, Discord, DingTalk, or LINE
246246

247-
| Channel | Setup |
248-
| ------------ | -------------------------- |
249-
| **Telegram** | Easy (just a token) |
250-
| **Discord** | Easy (bot token + intents) |
251-
| **QQ** | Easy (AppID + AppSecret) |
252-
| **DingTalk** | Medium (app credentials) |
247+
| Channel | Setup |
248+
| ------------ | ---------------------------------- |
249+
| **Telegram** | Easy (just a token) |
250+
| **Discord** | Easy (bot token + intents) |
251+
| **QQ** | Easy (AppID + AppSecret) |
252+
| **DingTalk** | Medium (app credentials) |
253+
| **LINE** | Medium (credentials + webhook URL) |
253254

254255
<details>
255256
<summary><b>Telegram</b> (Recommended)</summary>
@@ -399,6 +400,56 @@ picoclaw gateway
399400

400401
</details>
401402

403+
<details>
404+
<summary><b>LINE</b></summary>
405+
406+
**1. Create a LINE Official Account**
407+
408+
- Go to [LINE Developers Console](https://developers.line.biz/)
409+
- Create a provider → Create a Messaging API channel
410+
- Copy **Channel Secret** and **Channel Access Token**
411+
412+
**2. Configure**
413+
414+
```json
415+
{
416+
"channels": {
417+
"line": {
418+
"enabled": true,
419+
"channel_secret": "YOUR_CHANNEL_SECRET",
420+
"channel_access_token": "YOUR_CHANNEL_ACCESS_TOKEN",
421+
"webhook_host": "0.0.0.0",
422+
"webhook_port": 18791,
423+
"webhook_path": "/webhook/line",
424+
"allow_from": []
425+
}
426+
}
427+
}
428+
```
429+
430+
**3. Set up Webhook URL**
431+
432+
LINE requires HTTPS for webhooks. Use a reverse proxy or tunnel:
433+
434+
```bash
435+
# Example with ngrok
436+
ngrok http 18791
437+
```
438+
439+
Then set the Webhook URL in LINE Developers Console to `https://your-domain/webhook/line` and enable **Use webhook**.
440+
441+
**4. Run**
442+
443+
```bash
444+
picoclaw gateway
445+
```
446+
447+
> In group chats, the bot responds only when @mentioned. Replies quote the original message.
448+
449+
> **Docker Compose**: Add `ports: ["18791:18791"]` to the `picoclaw-gateway` service to expose the webhook port.
450+
451+
</details>
452+
402453
## <img src="assets/clawdchat-icon.png" width="24" height="24" alt="ClawdChat"> Join the Agent Social Network
403454

404455
Connect Picoclaw to the Agent Social Network simply by sending a single message via the CLI or any integrated Chat App.

assets/wechat.png

2.21 KB
Loading

config/config.example.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,15 @@
5151
"bot_token": "xoxb-YOUR-BOT-TOKEN",
5252
"app_token": "xapp-YOUR-APP-TOKEN",
5353
"allow_from": []
54+
},
55+
"line": {
56+
"enabled": false,
57+
"channel_secret": "YOUR_LINE_CHANNEL_SECRET",
58+
"channel_access_token": "YOUR_LINE_CHANNEL_ACCESS_TOKEN",
59+
"webhook_host": "0.0.0.0",
60+
"webhook_port": 18791,
61+
"webhook_path": "/webhook/line",
62+
"allow_from": []
5463
}
5564
},
5665
"providers": {

pkg/channels/base_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,3 @@ func TestBaseChannelIsAllowed(t *testing.T) {
5050
})
5151
}
5252
}
53-

0 commit comments

Comments
 (0)