mirror of
https://github.com/LLOneBot/LLOneBot.git
synced 2024-11-22 01:56:33 +00:00
feat: msg emoji like
This commit is contained in:
@@ -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,
|
||||
|
21
src/onebot11/event/notice/OB11MsgEmojiLikeEvent.ts
Normal file
21
src/onebot11/event/notice/OB11MsgEmojiLikeEvent.ts
Normal 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;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user