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:
@@ -43,8 +43,11 @@ export enum NTQQApiMethod {
|
|||||||
IMAGE_SIZE = "getImageSizeFromPath",
|
IMAGE_SIZE = "getImageSizeFromPath",
|
||||||
FILE_SIZE = "getFileSize",
|
FILE_SIZE = "getFileSize",
|
||||||
MEDIA_FILE_PATH = "nodeIKernelMsgService/getRichMediaFilePathForGuild",
|
MEDIA_FILE_PATH = "nodeIKernelMsgService/getRichMediaFilePathForGuild",
|
||||||
|
|
||||||
RECALL_MSG = "nodeIKernelMsgService/recallMsg",
|
RECALL_MSG = "nodeIKernelMsgService/recallMsg",
|
||||||
SEND_MSG = "nodeIKernelMsgService/sendMsg",
|
SEND_MSG = "nodeIKernelMsgService/sendMsg",
|
||||||
|
EMOJI_LIKE = "nodeIKernelMsgService/setMsgEmojiLikes",
|
||||||
|
|
||||||
DOWNLOAD_MEDIA = "nodeIKernelMsgService/downloadRichMedia",
|
DOWNLOAD_MEDIA = "nodeIKernelMsgService/downloadRichMedia",
|
||||||
FORWARD_MSG = "nodeIKernelMsgService/forwardMsgWithComment",
|
FORWARD_MSG = "nodeIKernelMsgService/forwardMsgWithComment",
|
||||||
MULTI_FORWARD_MSG = "nodeIKernelMsgService/multiForwardMsgWithComment", // 合并转发
|
MULTI_FORWARD_MSG = "nodeIKernelMsgService/multiForwardMsgWithComment", // 合并转发
|
||||||
|
@@ -205,6 +205,7 @@ export interface GrayTipElement {
|
|||||||
aioOpGrayTipElement: TipAioOpGrayTipElement,
|
aioOpGrayTipElement: TipAioOpGrayTipElement,
|
||||||
groupElement: TipGroupElement,
|
groupElement: TipGroupElement,
|
||||||
xmlElement: {
|
xmlElement: {
|
||||||
|
templId: string;
|
||||||
content: string;
|
content: string;
|
||||||
},
|
},
|
||||||
jsonGrayTipElement: {
|
jsonGrayTipElement: {
|
||||||
|
27
src/onebot11/action/msg/SetMsgEmojiLike.ts
Normal file
27
src/onebot11/action/msg/SetMsgEmojiLike.ts
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
import {ActionName} from "../types";
|
||||||
|
import BaseAction from "../BaseAction";
|
||||||
|
import {dbUtil} from "../../../common/db";
|
||||||
|
import {NTQQMsgApi} from "../../../ntqqapi/api/msg";
|
||||||
|
|
||||||
|
interface Payload {
|
||||||
|
message_id: number,
|
||||||
|
emoji_id: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export class SetMsgEmojiLike extends BaseAction<Payload, any> {
|
||||||
|
actionName = ActionName.SetMsgEmojiLike
|
||||||
|
|
||||||
|
protected async _handle(payload: Payload) {
|
||||||
|
let msg = await dbUtil.getMsgByShortId(payload.message_id)
|
||||||
|
if (!msg) {
|
||||||
|
throw new Error('msg not found')
|
||||||
|
}
|
||||||
|
if (!payload.emoji_id){
|
||||||
|
throw new Error('emojiId not found')
|
||||||
|
}
|
||||||
|
return await NTQQMsgApi.setEmojiLike({
|
||||||
|
chatType: msg.chatType,
|
||||||
|
peerUid: msg.peerUid
|
||||||
|
}, msg.msgSeq, payload.emoji_id, true)
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user