feat: 精简版本

This commit is contained in:
liyanyan 2026-03-15 22:40:54 +08:00
parent 7e98a8630f
commit 09ce2741d5
2 changed files with 6 additions and 6 deletions

View File

@ -25,12 +25,11 @@ Configure in `~/.openclaw/openclaw.json`:
channels: {
vocechat: {
enabled: true,
dmPolicy: "pairing",
accounts: {
default: {
serverUrl: "https://your-vocechat-server.com",
apiKey: "your-api-key",
botName: "OpenClaw Bot",
botApiKey: "your-api-key",
wsServerUrl: "wss://your-vocechat-server.com/ws",
},
},
},

View File

@ -13,7 +13,7 @@ export async function sendTextToVoceChat(
to?: string | null,
text?: string,
) {
const { serverUrl, apiKey } = cfg.channels?.vocechat|| {};
const { serverUrl, apiKey } = cfg.channels?.vocechat.default || {};
try {
// 根据聊天类型选择 API 端点
@ -46,7 +46,8 @@ export async function sendMarkdown(
accountId?: string | null,
text?: string,
) {
const { serverUrl, apiKey } = cfg.channels?.vocechat || {};
const { serverUrl, apiKey } =
cfg.channels?.vocechat?.[accountId || "default"] || {};
try {
const endpoint = `${serverUrl}/api/bot/send_to_user/${accountId}`;
@ -79,7 +80,7 @@ export async function replyToMessage(
text?: string,
mid?: string | number,
) {
const { serverUrl, apiKey } = cfg.channels?.vocechat || {};
const { serverUrl, apiKey } = cfg.channels?.vocechat?.[accountId || 'default'] || {};
try {
const endpoint = `${serverUrl}/api/bot/reply/${mid}`;