feat: 精简版本
This commit is contained in:
parent
7e98a8630f
commit
09ce2741d5
@ -25,12 +25,11 @@ Configure in `~/.openclaw/openclaw.json`:
|
|||||||
channels: {
|
channels: {
|
||||||
vocechat: {
|
vocechat: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
dmPolicy: "pairing",
|
|
||||||
accounts: {
|
accounts: {
|
||||||
default: {
|
default: {
|
||||||
serverUrl: "https://your-vocechat-server.com",
|
serverUrl: "https://your-vocechat-server.com",
|
||||||
apiKey: "your-api-key",
|
botApiKey: "your-api-key",
|
||||||
botName: "OpenClaw Bot",
|
wsServerUrl: "wss://your-vocechat-server.com/ws",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@ -13,7 +13,7 @@ export async function sendTextToVoceChat(
|
|||||||
to?: string | null,
|
to?: string | null,
|
||||||
text?: string,
|
text?: string,
|
||||||
) {
|
) {
|
||||||
const { serverUrl, apiKey } = cfg.channels?.vocechat|| {};
|
const { serverUrl, apiKey } = cfg.channels?.vocechat.default || {};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// 根据聊天类型选择 API 端点
|
// 根据聊天类型选择 API 端点
|
||||||
@ -46,7 +46,8 @@ export async function sendMarkdown(
|
|||||||
accountId?: string | null,
|
accountId?: string | null,
|
||||||
text?: string,
|
text?: string,
|
||||||
) {
|
) {
|
||||||
const { serverUrl, apiKey } = cfg.channels?.vocechat || {};
|
const { serverUrl, apiKey } =
|
||||||
|
cfg.channels?.vocechat?.[accountId || "default"] || {};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const endpoint = `${serverUrl}/api/bot/send_to_user/${accountId}`;
|
const endpoint = `${serverUrl}/api/bot/send_to_user/${accountId}`;
|
||||||
@ -79,7 +80,7 @@ export async function replyToMessage(
|
|||||||
text?: string,
|
text?: string,
|
||||||
mid?: string | number,
|
mid?: string | number,
|
||||||
) {
|
) {
|
||||||
const { serverUrl, apiKey } = cfg.channels?.vocechat || {};
|
const { serverUrl, apiKey } = cfg.channels?.vocechat?.[accountId || 'default'] || {};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const endpoint = `${serverUrl}/api/bot/reply/${mid}`;
|
const endpoint = `${serverUrl}/api/bot/reply/${mid}`;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user