xiaoxiaxia / scripts /feishu-setup.sh
sharween's picture
Upload scripts/feishu-setup.sh with huggingface_hub
12c15de verified
#!/bin/bash
# scripts/feishu-setup.sh — 飞书 5 机器人通道 + 5 Agent 绑定
set -e
STATE_DIR="${OPENCLAW_STATE_DIR:-/root/.openclaw}"
echo "🦞 Configuring Feishu channels..."
# 启用飞书插件
openclaw plugins enable feishu 2>/dev/null || true
for i in 1 2 3 4 5; do
app_id_var="FEISHU_APP_ID_${i}"
app_sec_var="FEISHU_APP_SECRET_${i}"
enabled_var="FEISHU_ENABLED_${i}"
app_id="${!app_id_var}"
app_sec="${!app_sec_var}"
enabled="${!enabled_var:-false}"
if [[ -n "$app_id" && -n "$app_sec" && "$enabled" == "true" ]]; then
account_id="feishu-agent-${i}"
echo " → Robot ${i} (${account_id})..."
export FEISHU_APP_ID="$app_id"
export FEISHU_APP_SECRET="$app_sec"
# Add channel account
openclaw channels add \
--channel feishu \
--account "$account_id" \
--token "${app_id}:${app_sec}" 2>/dev/null || \
openclaw config set "channels.${account_id}" "$(cat <<JSONEOF
{ "type": "feishu", "appId": "${app_id}", "appSecret": "${app_sec}" }
JSONEOF
)" 2>/dev/null || true
echo " ✅ Robot ${i} configured"
fi
done
echo "✅ Feishu setup done"