openclaw/.claude/DISCORD_NOTIFY.md
Shunsuke Hayashi 5456077858 refactor(lint): fix all remaining lint errors
- Add compare functions to sort() calls (7 locations)
- Fix await-thenable issues in browser modules
- Fix restrict-template-expressions with String() conversions
- Fix no-base-to-string with proper type handling

22 lint errors → 0 errors

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-26 13:30:25 +09:00

2.0 KiB

Clawdbot Discord 通知設定

概要

Clawdbot の Discord コネクションを使用して、Claude Code の操作完了時に Discord 通知を送信します。

設定手順

1. Discord チャンネル ID を取得

通知を送信したい Discord チャンネルの ID を取得します:

  1. Discord の設定 → 詳細設定 → 開発者モード をオン
  2. チャンネルを右クリック → ID をコピー
  3. チャンネル ID: 123456789012345678 のような形式

2. .env に設定

cd ~/dev/clawdbot
echo "DISCORD_NOTIFY_CHANNEL=123456789012345678" >> .env

3. Clawdbot Discord 接続を設定

# Discord アカウント連携
clawdbot login --channel discord

# 接続確認
clawdbot channels status --probe

4. 動作確認

# テスト通知
clawdbot message send \
  --channel discord \
  --target "123456789012345678" \
  --message "🤖 テスト通知"

通知タイミング

タイミング 内容
PostToolUse 操作完了時に Discord 通知を送信

環境変数

変数 説明
DISCORD_NOTIFY_CHANNEL 通知先 Discord チャンネル ID 123456789012345678
CLAWDBOT_DIR clawdbot のパス(任意) $HOME/dev/clawdbot

ファイル構成

.claude/
├── hooks/
│   └── discord-notify-clawdbot.sh  # Discord 通知スクリプト
├── settings.json                   # Claude Code フック設定
└── DISCORD_NOTIFY.md               # このドキュメント

トラブルシューティング

通知が届かない場合

  1. Discord 接続状態確認:

    clawdbot channels status
    
  2. チャンネル ID 確認:

    grep DISCORD_NOTIFY_CHANNEL .env
    
  3. 手動テスト:

    .claude/hooks/discord-notify-clawdbot.sh << EOF
    

{"content": "テスト通知"} EOF


### CLI がビルドされていない場合

```bash
cd ~/dev/clawdbot
pnpm build