diff --git a/manifest.json b/manifest.json index 725bfdc..6af9d6b 100644 --- a/manifest.json +++ b/manifest.json @@ -1,10 +1,10 @@ { "manifest_version": 4, "type": "extension", - "name": "LLOneBot v3.13.4", + "name": "LLOneBot v3.13.5", "slug": "LLOneBot", "description": "LiteLoaderQQNT的OneBotApi", - "version": "3.13.4", + "version": "3.13.5", "thumbnail": "./icon.png", "authors": [ { diff --git a/src/onebot11/action/BaseAction.ts b/src/onebot11/action/BaseAction.ts index 5d31019..09b3752 100644 --- a/src/onebot11/action/BaseAction.ts +++ b/src/onebot11/action/BaseAction.ts @@ -21,7 +21,7 @@ class BaseAction { const resData = await this._handle(payload); return OB11Response.ok(resData); } catch (e) { - log("发生错误", e.stack) + log("发生错误", e) return OB11Response.error(e.toString(), 200); } } @@ -35,7 +35,7 @@ class BaseAction { const resData = await this._handle(payload) return OB11Response.ok(resData, echo); } catch (e) { - log("发生错误", e.stack.toString()) + log("发生错误", e) return OB11Response.error(e.toString(), 1200, echo) } } diff --git a/src/onebot11/action/SendLike.ts b/src/onebot11/action/SendLike.ts index c26f412..fc87aa3 100644 --- a/src/onebot11/action/SendLike.ts +++ b/src/onebot11/action/SendLike.ts @@ -2,6 +2,7 @@ import BaseAction from "./BaseAction"; import {getFriend, getUidByUin, uidMaps} from "../../common/data"; import {NTQQApi} from "../../ntqqapi/ntcall"; import {ActionName} from "./types"; +import {log} from "../../common/utils"; interface Payload { user_id: number, @@ -12,16 +13,16 @@ export default class SendLike extends BaseAction { actionName = ActionName.SendLike protected async _handle(payload: Payload): Promise { - const qq = payload.user_id.toString(); - const friend = await getFriend(qq) - let uid: string; - if (!friend) { - uid = getUidByUin(qq) - } - else{ - uid = friend.uid - } + log("点赞参数", payload) try { + const qq = payload.user_id.toString(); + const friend = await getFriend(qq) + let uid: string; + if (!friend) { + uid = getUidByUin(qq) + } else { + uid = friend.uid + } let result = await NTQQApi.likeFriend(uid, parseInt(payload.times?.toString()) || 1); if (result.result !== 0) { throw result.errMsg diff --git a/src/onebot11/action/SendMsg.ts b/src/onebot11/action/SendMsg.ts index f3eea71..2f4c225 100644 --- a/src/onebot11/action/SendMsg.ts +++ b/src/onebot11/action/SendMsg.ts @@ -305,7 +305,7 @@ export class SendMsg extends BaseAction { case OB11MessageDataType.reply: { let replyMsgId = sendMsg.data.id; if (replyMsgId) { - const replyMsg = await dbUtil.getMsgBySeqId(replyMsgId) + const replyMsg = await dbUtil.getMsgByShortId(parseInt(replyMsgId)) if (replyMsg) { sendElements.push(SendMsgElementConstructor.reply(replyMsg.msgSeq, replyMsg.msgId, replyMsg.senderUin, replyMsg.senderUin)) } diff --git a/src/onebot11/server/ws/WebsocketServer.ts b/src/onebot11/server/ws/WebsocketServer.ts index 7d13b65..dc85fed 100644 --- a/src/onebot11/server/ws/WebsocketServer.ts +++ b/src/onebot11/server/ws/WebsocketServer.ts @@ -28,7 +28,7 @@ class OB11WebsocketServer extends WebsocketServerBase { let handleResult = await action.websocketHandle(params, echo); wsReply(wsClient, handleResult) } catch (e) { - wsReply(wsClient, OB11Response.error(`api处理出错:${e}`, 1200, echo)) + wsReply(wsClient, OB11Response.error(`api处理出错:${e.stack}`, 1200, echo)) } } diff --git a/src/version.ts b/src/version.ts index 32ac7a8..d34cb14 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const version = "3.13.4" \ No newline at end of file +export const version = "3.13.5" \ No newline at end of file