mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-21 09:36:35 +00:00
feat: 被点赞事件
This commit is contained in:
parent
1e63a2a7e7
commit
b8457d4aff
@ -1,22 +1,18 @@
|
|||||||
syntax = 'proto3';
|
syntax = "proto3";
|
||||||
package SysMessage;
|
package SysMessage;
|
||||||
|
|
||||||
message ProfileLikeTip {
|
message likeDetail {
|
||||||
ProfileLikeDetail profile_like_detail = 203;
|
string txt = 1;
|
||||||
|
int64 uin = 3;
|
||||||
|
string nickname = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
message ProfileLikeDetail {
|
message likeMsg {
|
||||||
LikeDetail like_detail = 14;
|
int32 times = 1;
|
||||||
|
int32 time = 2;
|
||||||
|
likeDetail detail = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
message LikeDetail {
|
message profileLikeTip {
|
||||||
int32 times = 1;
|
likeMsg msg = 14;
|
||||||
int32 time = 2;
|
|
||||||
TextTip text_tip = 3;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
message TextTip {
|
|
||||||
string txt = 1;
|
|
||||||
int64 qq = 2;
|
|
||||||
string nick = 3;
|
|
||||||
}
|
|
@ -1,5 +1,5 @@
|
|||||||
// @generated by protobuf-ts 2.9.4
|
// @generated by protobuf-ts 2.9.4
|
||||||
// @generated from protobuf file "ProfileLikeTip.proto" (package "SysMessage", syntax proto3)
|
// @generated from protobuf file "ProfilelikeTip.proto" (package "SysMessage", syntax proto3)
|
||||||
// tslint:disable
|
// tslint:disable
|
||||||
import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
|
import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
|
||||||
import type { IBinaryWriter } from "@protobuf-ts/runtime";
|
import type { IBinaryWriter } from "@protobuf-ts/runtime";
|
||||||
@ -11,27 +11,26 @@ import type { PartialMessage } from "@protobuf-ts/runtime";
|
|||||||
import { reflectionMergePartial } from "@protobuf-ts/runtime";
|
import { reflectionMergePartial } from "@protobuf-ts/runtime";
|
||||||
import { MessageType } from "@protobuf-ts/runtime";
|
import { MessageType } from "@protobuf-ts/runtime";
|
||||||
/**
|
/**
|
||||||
* @generated from protobuf message SysMessage.ProfileLikeTip
|
* @generated from protobuf message SysMessage.likeDetail
|
||||||
*/
|
*/
|
||||||
export interface ProfileLikeTip {
|
export interface likeDetail {
|
||||||
/**
|
/**
|
||||||
* @generated from protobuf field: SysMessage.ProfileLikeDetail profile_like_detail = 203;
|
* @generated from protobuf field: string txt = 1;
|
||||||
*/
|
*/
|
||||||
profileLikeDetail?: ProfileLikeDetail;
|
txt: string;
|
||||||
|
/**
|
||||||
|
* @generated from protobuf field: int64 uin = 3;
|
||||||
|
*/
|
||||||
|
uin: bigint;
|
||||||
|
/**
|
||||||
|
* @generated from protobuf field: string nickname = 5;
|
||||||
|
*/
|
||||||
|
nickname: string;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @generated from protobuf message SysMessage.ProfileLikeDetail
|
* @generated from protobuf message SysMessage.likeMsg
|
||||||
*/
|
*/
|
||||||
export interface ProfileLikeDetail {
|
export interface likeMsg {
|
||||||
/**
|
|
||||||
* @generated from protobuf field: SysMessage.LikeDetail like_detail = 14;
|
|
||||||
*/
|
|
||||||
likeDetail?: LikeDetail;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @generated from protobuf message SysMessage.LikeDetail
|
|
||||||
*/
|
|
||||||
export interface LikeDetail {
|
|
||||||
/**
|
/**
|
||||||
* @generated from protobuf field: int32 times = 1;
|
* @generated from protobuf field: int32 times = 1;
|
||||||
*/
|
*/
|
||||||
@ -41,47 +40,50 @@ export interface LikeDetail {
|
|||||||
*/
|
*/
|
||||||
time: number;
|
time: number;
|
||||||
/**
|
/**
|
||||||
* @generated from protobuf field: SysMessage.TextTip text_tip = 3;
|
* @generated from protobuf field: SysMessage.likeDetail detail = 3;
|
||||||
*/
|
*/
|
||||||
textTip?: TextTip;
|
detail?: likeDetail;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @generated from protobuf message SysMessage.TextTip
|
* @generated from protobuf message SysMessage.profileLikeTip
|
||||||
*/
|
*/
|
||||||
export interface TextTip {
|
export interface profileLikeTip {
|
||||||
/**
|
/**
|
||||||
* @generated from protobuf field: string txt = 1;
|
* @generated from protobuf field: SysMessage.likeMsg msg = 14;
|
||||||
*/
|
*/
|
||||||
txt: string;
|
msg?: likeMsg;
|
||||||
/**
|
|
||||||
* @generated from protobuf field: int64 qq = 2;
|
|
||||||
*/
|
|
||||||
qq: bigint;
|
|
||||||
/**
|
|
||||||
* @generated from protobuf field: string nick = 3;
|
|
||||||
*/
|
|
||||||
nick: string;
|
|
||||||
}
|
}
|
||||||
// @generated message type with reflection information, may provide speed optimized methods
|
// @generated message type with reflection information, may provide speed optimized methods
|
||||||
class ProfileLikeTip$Type extends MessageType<ProfileLikeTip> {
|
class likeDetail$Type extends MessageType<likeDetail> {
|
||||||
constructor() {
|
constructor() {
|
||||||
super("SysMessage.ProfileLikeTip", [
|
super("SysMessage.likeDetail", [
|
||||||
{ no: 203, name: "profile_like_detail", kind: "message", T: () => ProfileLikeDetail }
|
{ no: 1, name: "txt", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
||||||
|
{ no: 3, name: "uin", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
|
||||||
|
{ no: 5, name: "nickname", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
create(value?: PartialMessage<ProfileLikeTip>): ProfileLikeTip {
|
create(value?: PartialMessage<likeDetail>): likeDetail {
|
||||||
const message = globalThis.Object.create((this.messagePrototype!));
|
const message = globalThis.Object.create((this.messagePrototype!));
|
||||||
|
message.txt = "";
|
||||||
|
message.uin = 0n;
|
||||||
|
message.nickname = "";
|
||||||
if (value !== undefined)
|
if (value !== undefined)
|
||||||
reflectionMergePartial<ProfileLikeTip>(this, message, value);
|
reflectionMergePartial<likeDetail>(this, message, value);
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ProfileLikeTip): ProfileLikeTip {
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: likeDetail): likeDetail {
|
||||||
let message = target ?? this.create(), end = reader.pos + length;
|
let message = target ?? this.create(), end = reader.pos + length;
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
let [fieldNo, wireType] = reader.tag();
|
let [fieldNo, wireType] = reader.tag();
|
||||||
switch (fieldNo) {
|
switch (fieldNo) {
|
||||||
case /* SysMessage.ProfileLikeDetail profile_like_detail */ 203:
|
case /* string txt */ 1:
|
||||||
message.profileLikeDetail = ProfileLikeDetail.internalBinaryRead(reader, reader.uint32(), options, message.profileLikeDetail);
|
message.txt = reader.string();
|
||||||
|
break;
|
||||||
|
case /* int64 uin */ 3:
|
||||||
|
message.uin = reader.int64().toBigInt();
|
||||||
|
break;
|
||||||
|
case /* string nickname */ 5:
|
||||||
|
message.nickname = reader.string();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
let u = options.readUnknownField;
|
let u = options.readUnknownField;
|
||||||
@ -94,10 +96,16 @@ class ProfileLikeTip$Type extends MessageType<ProfileLikeTip> {
|
|||||||
}
|
}
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
internalBinaryWrite(message: ProfileLikeTip, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
internalBinaryWrite(message: likeDetail, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
||||||
/* SysMessage.ProfileLikeDetail profile_like_detail = 203; */
|
/* string txt = 1; */
|
||||||
if (message.profileLikeDetail)
|
if (message.txt !== "")
|
||||||
ProfileLikeDetail.internalBinaryWrite(message.profileLikeDetail, writer.tag(203, WireType.LengthDelimited).fork(), options).join();
|
writer.tag(1, WireType.LengthDelimited).string(message.txt);
|
||||||
|
/* int64 uin = 3; */
|
||||||
|
if (message.uin !== 0n)
|
||||||
|
writer.tag(3, WireType.Varint).int64(message.uin);
|
||||||
|
/* string nickname = 5; */
|
||||||
|
if (message.nickname !== "")
|
||||||
|
writer.tag(5, WireType.LengthDelimited).string(message.nickname);
|
||||||
let u = options.writeUnknownFields;
|
let u = options.writeUnknownFields;
|
||||||
if (u !== false)
|
if (u !== false)
|
||||||
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
||||||
@ -105,73 +113,27 @@ class ProfileLikeTip$Type extends MessageType<ProfileLikeTip> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @generated MessageType for protobuf message SysMessage.ProfileLikeTip
|
* @generated MessageType for protobuf message SysMessage.likeDetail
|
||||||
*/
|
*/
|
||||||
export const ProfileLikeTip = new ProfileLikeTip$Type();
|
export const likeDetail = new likeDetail$Type();
|
||||||
// @generated message type with reflection information, may provide speed optimized methods
|
// @generated message type with reflection information, may provide speed optimized methods
|
||||||
class ProfileLikeDetail$Type extends MessageType<ProfileLikeDetail> {
|
class likeMsg$Type extends MessageType<likeMsg> {
|
||||||
constructor() {
|
constructor() {
|
||||||
super("SysMessage.ProfileLikeDetail", [
|
super("SysMessage.likeMsg", [
|
||||||
{ no: 14, name: "like_detail", kind: "message", T: () => LikeDetail }
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
create(value?: PartialMessage<ProfileLikeDetail>): ProfileLikeDetail {
|
|
||||||
const message = globalThis.Object.create((this.messagePrototype!));
|
|
||||||
if (value !== undefined)
|
|
||||||
reflectionMergePartial<ProfileLikeDetail>(this, message, value);
|
|
||||||
return message;
|
|
||||||
}
|
|
||||||
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ProfileLikeDetail): ProfileLikeDetail {
|
|
||||||
let message = target ?? this.create(), end = reader.pos + length;
|
|
||||||
while (reader.pos < end) {
|
|
||||||
let [fieldNo, wireType] = reader.tag();
|
|
||||||
switch (fieldNo) {
|
|
||||||
case /* SysMessage.LikeDetail like_detail */ 14:
|
|
||||||
message.likeDetail = LikeDetail.internalBinaryRead(reader, reader.uint32(), options, message.likeDetail);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
let u = options.readUnknownField;
|
|
||||||
if (u === "throw")
|
|
||||||
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
||||||
let d = reader.skip(wireType);
|
|
||||||
if (u !== false)
|
|
||||||
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return message;
|
|
||||||
}
|
|
||||||
internalBinaryWrite(message: ProfileLikeDetail, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
|
||||||
/* SysMessage.LikeDetail like_detail = 14; */
|
|
||||||
if (message.likeDetail)
|
|
||||||
LikeDetail.internalBinaryWrite(message.likeDetail, writer.tag(14, WireType.LengthDelimited).fork(), options).join();
|
|
||||||
let u = options.writeUnknownFields;
|
|
||||||
if (u !== false)
|
|
||||||
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
||||||
return writer;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @generated MessageType for protobuf message SysMessage.ProfileLikeDetail
|
|
||||||
*/
|
|
||||||
export const ProfileLikeDetail = new ProfileLikeDetail$Type();
|
|
||||||
// @generated message type with reflection information, may provide speed optimized methods
|
|
||||||
class LikeDetail$Type extends MessageType<LikeDetail> {
|
|
||||||
constructor() {
|
|
||||||
super("SysMessage.LikeDetail", [
|
|
||||||
{ no: 1, name: "times", kind: "scalar", T: 5 /*ScalarType.INT32*/ },
|
{ no: 1, name: "times", kind: "scalar", T: 5 /*ScalarType.INT32*/ },
|
||||||
{ no: 2, name: "time", kind: "scalar", T: 5 /*ScalarType.INT32*/ },
|
{ no: 2, name: "time", kind: "scalar", T: 5 /*ScalarType.INT32*/ },
|
||||||
{ no: 3, name: "text_tip", kind: "message", T: () => TextTip }
|
{ no: 3, name: "detail", kind: "message", T: () => likeDetail }
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
create(value?: PartialMessage<LikeDetail>): LikeDetail {
|
create(value?: PartialMessage<likeMsg>): likeMsg {
|
||||||
const message = globalThis.Object.create((this.messagePrototype!));
|
const message = globalThis.Object.create((this.messagePrototype!));
|
||||||
message.times = 0;
|
message.times = 0;
|
||||||
message.time = 0;
|
message.time = 0;
|
||||||
if (value !== undefined)
|
if (value !== undefined)
|
||||||
reflectionMergePartial<LikeDetail>(this, message, value);
|
reflectionMergePartial<likeMsg>(this, message, value);
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: LikeDetail): LikeDetail {
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: likeMsg): likeMsg {
|
||||||
let message = target ?? this.create(), end = reader.pos + length;
|
let message = target ?? this.create(), end = reader.pos + length;
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
let [fieldNo, wireType] = reader.tag();
|
let [fieldNo, wireType] = reader.tag();
|
||||||
@ -182,8 +144,8 @@ class LikeDetail$Type extends MessageType<LikeDetail> {
|
|||||||
case /* int32 time */ 2:
|
case /* int32 time */ 2:
|
||||||
message.time = reader.int32();
|
message.time = reader.int32();
|
||||||
break;
|
break;
|
||||||
case /* SysMessage.TextTip text_tip */ 3:
|
case /* SysMessage.likeDetail detail */ 3:
|
||||||
message.textTip = TextTip.internalBinaryRead(reader, reader.uint32(), options, message.textTip);
|
message.detail = likeDetail.internalBinaryRead(reader, reader.uint32(), options, message.detail);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
let u = options.readUnknownField;
|
let u = options.readUnknownField;
|
||||||
@ -196,16 +158,16 @@ class LikeDetail$Type extends MessageType<LikeDetail> {
|
|||||||
}
|
}
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
internalBinaryWrite(message: LikeDetail, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
internalBinaryWrite(message: likeMsg, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
||||||
/* int32 times = 1; */
|
/* int32 times = 1; */
|
||||||
if (message.times !== 0)
|
if (message.times !== 0)
|
||||||
writer.tag(1, WireType.Varint).int32(message.times);
|
writer.tag(1, WireType.Varint).int32(message.times);
|
||||||
/* int32 time = 2; */
|
/* int32 time = 2; */
|
||||||
if (message.time !== 0)
|
if (message.time !== 0)
|
||||||
writer.tag(2, WireType.Varint).int32(message.time);
|
writer.tag(2, WireType.Varint).int32(message.time);
|
||||||
/* SysMessage.TextTip text_tip = 3; */
|
/* SysMessage.likeDetail detail = 3; */
|
||||||
if (message.textTip)
|
if (message.detail)
|
||||||
TextTip.internalBinaryWrite(message.textTip, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
|
likeDetail.internalBinaryWrite(message.detail, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
|
||||||
let u = options.writeUnknownFields;
|
let u = options.writeUnknownFields;
|
||||||
if (u !== false)
|
if (u !== false)
|
||||||
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
||||||
@ -213,40 +175,29 @@ class LikeDetail$Type extends MessageType<LikeDetail> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @generated MessageType for protobuf message SysMessage.LikeDetail
|
* @generated MessageType for protobuf message SysMessage.likeMsg
|
||||||
*/
|
*/
|
||||||
export const LikeDetail = new LikeDetail$Type();
|
export const likeMsg = new likeMsg$Type();
|
||||||
// @generated message type with reflection information, may provide speed optimized methods
|
// @generated message type with reflection information, may provide speed optimized methods
|
||||||
class TextTip$Type extends MessageType<TextTip> {
|
class profileLikeTip$Type extends MessageType<profileLikeTip> {
|
||||||
constructor() {
|
constructor() {
|
||||||
super("SysMessage.TextTip", [
|
super("SysMessage.profileLikeTip", [
|
||||||
{ no: 1, name: "txt", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
{ no: 14, name: "msg", kind: "message", T: () => likeMsg }
|
||||||
{ no: 2, name: "qq", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
|
|
||||||
{ no: 3, name: "nick", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
create(value?: PartialMessage<TextTip>): TextTip {
|
create(value?: PartialMessage<profileLikeTip>): profileLikeTip {
|
||||||
const message = globalThis.Object.create((this.messagePrototype!));
|
const message = globalThis.Object.create((this.messagePrototype!));
|
||||||
message.txt = "";
|
|
||||||
message.qq = 0n;
|
|
||||||
message.nick = "";
|
|
||||||
if (value !== undefined)
|
if (value !== undefined)
|
||||||
reflectionMergePartial<TextTip>(this, message, value);
|
reflectionMergePartial<profileLikeTip>(this, message, value);
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TextTip): TextTip {
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: profileLikeTip): profileLikeTip {
|
||||||
let message = target ?? this.create(), end = reader.pos + length;
|
let message = target ?? this.create(), end = reader.pos + length;
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
let [fieldNo, wireType] = reader.tag();
|
let [fieldNo, wireType] = reader.tag();
|
||||||
switch (fieldNo) {
|
switch (fieldNo) {
|
||||||
case /* string txt */ 1:
|
case /* SysMessage.likeMsg msg */ 14:
|
||||||
message.txt = reader.string();
|
message.msg = likeMsg.internalBinaryRead(reader, reader.uint32(), options, message.msg);
|
||||||
break;
|
|
||||||
case /* int64 qq */ 2:
|
|
||||||
message.qq = reader.int64().toBigInt();
|
|
||||||
break;
|
|
||||||
case /* string nick */ 3:
|
|
||||||
message.nick = reader.string();
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
let u = options.readUnknownField;
|
let u = options.readUnknownField;
|
||||||
@ -259,16 +210,10 @@ class TextTip$Type extends MessageType<TextTip> {
|
|||||||
}
|
}
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
internalBinaryWrite(message: TextTip, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
internalBinaryWrite(message: profileLikeTip, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
||||||
/* string txt = 1; */
|
/* SysMessage.likeMsg msg = 14; */
|
||||||
if (message.txt !== "")
|
if (message.msg)
|
||||||
writer.tag(1, WireType.LengthDelimited).string(message.txt);
|
likeMsg.internalBinaryWrite(message.msg, writer.tag(14, WireType.LengthDelimited).fork(), options).join();
|
||||||
/* int64 qq = 2; */
|
|
||||||
if (message.qq !== 0n)
|
|
||||||
writer.tag(2, WireType.Varint).int64(message.qq);
|
|
||||||
/* string nick = 3; */
|
|
||||||
if (message.nick !== "")
|
|
||||||
writer.tag(3, WireType.LengthDelimited).string(message.nick);
|
|
||||||
let u = options.writeUnknownFields;
|
let u = options.writeUnknownFields;
|
||||||
if (u !== false)
|
if (u !== false)
|
||||||
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
||||||
@ -276,6 +221,6 @@ class TextTip$Type extends MessageType<TextTip> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @generated MessageType for protobuf message SysMessage.TextTip
|
* @generated MessageType for protobuf message SysMessage.profileLikeTip
|
||||||
*/
|
*/
|
||||||
export const TextTip = new TextTip$Type();
|
export const profileLikeTip = new profileLikeTip$Type();
|
||||||
|
19
src/onebot/event/notice/OB11ProfileLikeEvent.ts
Normal file
19
src/onebot/event/notice/OB11ProfileLikeEvent.ts
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
import { OB11BaseNoticeEvent } from './OB11BaseNoticeEvent';
|
||||||
|
import { NapCatCore } from '@/core';
|
||||||
|
|
||||||
|
export class OB11ProfileLikeEvent extends OB11BaseNoticeEvent {
|
||||||
|
notice_type = 'notify';
|
||||||
|
sub_type = 'profile_like';
|
||||||
|
operator_id: number;
|
||||||
|
operator_nick: string;
|
||||||
|
times: number;
|
||||||
|
time: number;
|
||||||
|
|
||||||
|
constructor(core: NapCatCore, operatorId: number, operatorNick: string, times: number, time: number) {
|
||||||
|
super(core);
|
||||||
|
this.operator_id = operatorId;
|
||||||
|
this.operator_nick = operatorNick;
|
||||||
|
this.times = times;
|
||||||
|
this.time = time;
|
||||||
|
}
|
||||||
|
}
|
@ -44,9 +44,8 @@ import { OB11GroupRecallNoticeEvent } from '@/onebot/event/notice/OB11GroupRecal
|
|||||||
import { LRUCache } from '@/common/lru-cache';
|
import { LRUCache } from '@/common/lru-cache';
|
||||||
import { NodeIKernelRecentContactListener } from '@/core/listeners/NodeIKernelRecentContactListener';
|
import { NodeIKernelRecentContactListener } from '@/core/listeners/NodeIKernelRecentContactListener';
|
||||||
import { SysMessage } from '@/core/proto/SysMessage';
|
import { SysMessage } from '@/core/proto/SysMessage';
|
||||||
import { ProfileLikeTip } from '@/core/proto/ProfileLikeTip';
|
import { profileLikeTip } from '@/core/proto/ProfileLikeTip';
|
||||||
import util from 'util';
|
import { OB11ProfileLikeEvent } from './event/notice/OB11ProfileLikeEvent';
|
||||||
import { time } from 'console';
|
|
||||||
|
|
||||||
//OneBot实现类
|
//OneBot实现类
|
||||||
export class NapCatOneBot11Adapter {
|
export class NapCatOneBot11Adapter {
|
||||||
@ -243,22 +242,25 @@ export class NapCatOneBot11Adapter {
|
|||||||
const msgListener = new NodeIKernelMsgListener();
|
const msgListener = new NodeIKernelMsgListener();
|
||||||
|
|
||||||
msgListener.onRecvSysMsg = async (msg) => {
|
msgListener.onRecvSysMsg = async (msg) => {
|
||||||
console.log('收到系统消息', util.inspect(msg, { depth: null, maxArrayLength: null }));
|
|
||||||
const sysMsg = SysMessage.fromBinary(Uint8Array.from(msg));
|
const sysMsg = SysMessage.fromBinary(Uint8Array.from(msg));
|
||||||
if (sysMsg.msgSpec.length === 0) {
|
if (sysMsg.msgSpec.length === 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
console.log( '收到系统消息:Uint8Array:', util.inspect(Uint8Array.from(msg), { depth: null, maxArrayLength: null }));
|
|
||||||
const { msgType, subType, subSubType } = sysMsg.msgSpec[0];
|
const { msgType, subType, subSubType } = sysMsg.msgSpec[0];
|
||||||
this.core.context.logger.log('收到系统消息类型', msgType, subType, subSubType);
|
|
||||||
if (msgType === 528 && subType === 39 && subSubType === 39) {
|
if (msgType === 528 && subType === 39 && subSubType === 39) {
|
||||||
console.log(util.inspect(sysMsg.bodyWrapper!.wrappedBody, { depth: null, maxArrayLength: null }));
|
const likeTip = profileLikeTip.fromBinary(Uint8Array.from(sysMsg.bodyWrapper!.wrappedBody.slice(12)));
|
||||||
const profileLikeTip = ProfileLikeTip.fromBinary(Uint8Array.from(sysMsg.bodyWrapper!.wrappedBody));
|
this.core.context.logger.logDebug("收到点赞通知消息");
|
||||||
console.log("点赞提示: ", profileLikeTip);
|
if (!likeTip.msg) return;
|
||||||
if (profileLikeTip.profileLikeDetail?.likeDetail) {
|
const detail = likeTip.msg.detail;
|
||||||
const detail = profileLikeTip.profileLikeDetail.likeDetail.textTip;
|
if (!detail) return;
|
||||||
console.log("点赞详情: ", detail, "时间: ", Date.parse(profileLikeTip.profileLikeDetail.likeDetail.time.toString()));
|
const times = detail.txt.match(/\d+/) ?? "0";
|
||||||
}
|
await this.networkManager.emitEvent(new OB11ProfileLikeEvent(
|
||||||
|
this.core,
|
||||||
|
Number(detail.uin),
|
||||||
|
detail.nickname,
|
||||||
|
parseInt(times[0], 10),
|
||||||
|
likeTip.msg.time,
|
||||||
|
)).catch(e => this.context.logger.logError('处理被点赞事件失败', e));
|
||||||
};
|
};
|
||||||
// if (msgType === 732 && subType === 16 && subSubType === 16) {
|
// if (msgType === 732 && subType === 16 && subSubType === 16) {
|
||||||
// const greyTip = GreyTipWrapper.fromBinary(Uint8Array.from(sysMsg.bodyWrapper!.wrappedBody.slice(7)));
|
// const greyTip = GreyTipWrapper.fromBinary(Uint8Array.from(sysMsg.bodyWrapper!.wrappedBody.slice(7)));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user