diff --git a/src/adapters/icqq/index.ts b/src/adapters/icqq/index.ts index d2e0993..40c30d0 100644 --- a/src/adapters/icqq/index.ts +++ b/src/adapters/icqq/index.ts @@ -1,6 +1,6 @@ import { Adapter } from "@/adapter"; import { App } from "@/server/app"; -import { Client, Config as IcqqConfig, MessageElem, Quotable, Sendable } from "@icqqjs/icqq"; +import { Client, Config as IcqqConfig, Quotable, Sendable } from "@icqqjs/icqq"; import process from "process"; import { rmSync } from "fs"; import { OneBot, OneBotStatus } from "@/onebot"; @@ -294,13 +294,14 @@ export default class IcqqAdapter extends Adapter<"icqq", Sendable> { .map(item => { if (typeof item === "string") return item; const { type, data } = item; - if (type === "node") + if (type === "node") { return { type, - user_id: data.user_id, - nickname: data.nickname, - message: this.fromSegment(onebot, version, data.message), + user_id: data.user_id || data.uin, + nickname: data.nickname || data.name, + message: this.fromSegment(onebot, version, data.content) }; + } return { type, ...data }; }); } diff --git a/src/service/V11/action/common.ts b/src/service/V11/action/common.ts index 4a3e96f..f97b1ab 100644 --- a/src/service/V11/action/common.ts +++ b/src/service/V11/action/common.ts @@ -1,5 +1,6 @@ import { OneBotStatus } from "@/onebot"; import { V11 } from "@/service/V11"; +import { version } from "@/utils"; export class CommonAction { /** @@ -77,10 +78,10 @@ export class CommonAction { /** * 获取版本信息 */ - getVersion(this: V11) { + getVersionInfo(this: V11) { return { - app_name: "icqq", - app_version: "2.x", + app_name: "onebots", + app_version: version, protocol_version: "v11", }; } diff --git a/src/service/V11/index.ts b/src/service/V11/index.ts index 75512fa..c3f6e85 100644 --- a/src/service/V11/index.ts +++ b/src/service/V11/index.ts @@ -456,6 +456,7 @@ export class V11 extends Service<"V11"> implements OneBot.Base { } else { code = 1400; message = "请求格式错误"; + this.logger.error("_webSocketHandler fail: ", e); } ws.send( JSON.stringify({