mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-03-01 16:20:25 +00:00
Merge branch 'main' of https://github.com/NapNeko/NapCatQQ
This commit is contained in:
@@ -46,6 +46,7 @@ import GetFile from './file/GetFile';
|
||||
import { GoCQHTTGetForwardMsgAction } from './go-cqhttp/GetForwardMsg';
|
||||
import GetFriendMsgHistory from './go-cqhttp/GetFriendMsgHistory';
|
||||
import { GetCookies } from './user/GetCookies';
|
||||
import { SetMsgEmojiLike } from '@/onebot11/action/msg/SetMsgEmojiLike';
|
||||
|
||||
export const actionHandlers = [
|
||||
new GetFile(),
|
||||
@@ -80,6 +81,7 @@ export const actionHandlers = [
|
||||
new SetGroupCard(),
|
||||
new GetImage(),
|
||||
new GetRecord(),
|
||||
new SetMsgEmojiLike(),
|
||||
// new CleanCache(),
|
||||
new GetCookies(),
|
||||
//以下为go-cqhttp api
|
||||
|
||||
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/utils/db';
|
||||
import { NTQQMsgApi } from '@/core/apis';
|
||||
|
||||
interface Payload {
|
||||
message_id: number,
|
||||
emoji_id: string
|
||||
}
|
||||
|
||||
export class SetMsgEmojiLike extends BaseAction<Payload, any> {
|
||||
actionName = ActionName.SetMsgEmojiLike;
|
||||
|
||||
protected async _handle(payload: Payload) {
|
||||
const 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);
|
||||
}
|
||||
}
|
||||
@@ -34,6 +34,7 @@ export enum ActionName {
|
||||
SendGroupMsg = 'send_group_msg',
|
||||
SendPrivateMsg = 'send_private_msg',
|
||||
DeleteMsg = 'delete_msg',
|
||||
SetMsgEmojiLike = 'set_msg_emoji_like',
|
||||
SetGroupAddRequest = 'set_group_add_request',
|
||||
SetFriendAddRequest = 'set_friend_add_request',
|
||||
SetGroupLeave = 'set_group_leave',
|
||||
@@ -51,6 +52,7 @@ export enum ActionName {
|
||||
GetRecord = 'get_record',
|
||||
CleanCache = 'clean_cache',
|
||||
GetCookies = "get_cookies",
|
||||
|
||||
// 以下为go-cqhttp api
|
||||
GoCQHTTP_SendForwardMsg = 'send_forward_msg',
|
||||
GoCQHTTP_SendGroupForwardMsg = 'send_group_forward_msg',
|
||||
|
||||
Reference in New Issue
Block a user