feat: msg emoji like

This commit is contained in:
linyuchen
2024-04-25 23:25:38 +08:00
parent 3ae2d2a1e6
commit b7855e91f6
2 changed files with 32 additions and 0 deletions

View File

@@ -16,6 +16,17 @@ export interface Peer {
}
export class NTQQMsgApi {
static async setEmojiLike(peer: Peer, msgSeq: string, emojiId: string, set: boolean=true){
// nt_qq//global//nt_data//Emoji//emoji-resource//sysface_res/apng/ 下可以看到所有QQ表情预览
// nt_qq\global\nt_data\Emoji\emoji-resource\face_config.json 里面有所有表情的id, 自带表情id是QSid, 标准emoji表情id是QCid
// 其实以官方文档为准是最好的https://bot.q.qq.com/wiki/develop/api-v2/openapi/emoji/model.html#EmojiType
return await callNTQQApi<GeneralCallResult>({
methodName: NTQQApiMethod.EMOJI_LIKE,
args: [{
peer, msgSeq, emojiId, emojiType: emojiId.length > 3 ? "2" : "1", setEmoji: set
}, null]
})
}
static async getMultiMsg(peer: Peer, rootMsgId: string, parentMsgId: string) {
return await callNTQQApi<GeneralCallResult & {msgList: RawMessage[]}>({
methodName: NTQQApiMethod.GET_MULTI_MSG,

View File

@@ -0,0 +1,21 @@
import {OB11GroupNoticeEvent} from "./OB11GroupNoticeEvent";
export interface MsgEmojiLike {
emoji_id: string,
count: number
}
export class OB11GroupMsgEmojiLikeEvent extends OB11GroupNoticeEvent {
notice_type = "group_msg_emoji_like";
message_id: number;
sub_type: "ban" | "lift_ban";
likes: MsgEmojiLike[]
constructor(groupId: number, userId: number, messageId: number, likes: MsgEmojiLike[]) {
super();
this.group_id = groupId;
this.user_id = userId; // 可为空表示是对别人的消息操作如果是对bot自己的消息则不为空
this.message_id = messageId;
this.likes = likes;
}
}