diff --git a/src/core/packet/msg/builder.ts b/src/core/packet/msg/builder.ts index 15fe5878..fe201757 100644 --- a/src/core/packet/msg/builder.ts +++ b/src/core/packet/msg/builder.ts @@ -50,7 +50,7 @@ export class PacketMsgBuilder { divSeq: node.groupId ? undefined : 4, msgId: crypto.randomBytes(4).readUInt32LE(0), sequence: crypto.randomBytes(4).readUInt32LE(0), - timeStamp: Math.floor(Date.now() / 1000), + timeStamp: +node.time.toString().substring(0, 10), field7: BigInt(1), field8: 0, field9: 0, diff --git a/src/onebot/action/msg/SendMsg.ts b/src/onebot/action/msg/SendMsg.ts index 75f03975..92633dd6 100644 --- a/src/onebot/action/msg/SendMsg.ts +++ b/src/onebot/action/msg/SendMsg.ts @@ -187,7 +187,7 @@ export class SendMsg extends BaseAction { senderUin: Number(node.data.user_id ?? parentMeta?.user_id) || +this.core.selfInfo.uin, senderName: node.data.nickname ?? parentMeta?.nickname ?? "QQ用户", groupId: msgPeer.chatType === ChatType.KCHATTYPEGROUP ? +msgPeer.peerUid : undefined, - time: Date.now(), + time: Number(node.data.time) || Date.now(), msg: sendElements, }; logger.logDebug(`handleForwardedNodesPacket 开始转换 ${JSON.stringify(packetMsgElements)}`); diff --git a/src/onebot/types/message.ts b/src/onebot/types/message.ts index f73852ba..3226d7a0 100644 --- a/src/onebot/types/message.ts +++ b/src/onebot/types/message.ts @@ -155,7 +155,8 @@ export interface OB11MessageNode { source?: string, news?: { text: string }[], summary?: string, - prompt?: string + prompt?: string + time?: string }; } @@ -229,6 +230,7 @@ export interface OB11PostSendMsg { news?: { text: string }[], summary?: string, prompt?: string + time?: string } export interface OB11PostContext { message_type?: 'private' | 'group'