feat: 精简版本
This commit is contained in:
parent
7e98a8630f
commit
09ce2741d5
@ -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",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@ -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}`;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user