feat: delete msg

This commit is contained in:
linyuchen 2024-02-12 22:12:25 +08:00
parent 0a8e25c121
commit edcf3f2592
2 changed files with 25 additions and 1 deletions

View File

@ -0,0 +1,22 @@
import { ActionName } from "./types";
import BaseAction from "./BaseAction";
import { NTQQApi } from "../../ntqqapi/ntcall";
import { msgHistory } from "../../common/data";
interface Payload {
message_id: string
}
class DeleteMsg extends BaseAction<Payload, void> {
actionName = ActionName.DeleteMsg
protected async _handle(payload:Payload){
let msg = msgHistory[payload.message_id]
await NTQQApi.recallMsg({
chatType: msg.chatType,
peerUid: msg.peerUid
}, [payload.message_id])
}
}
export default DeleteMsg

View File

@ -8,11 +8,13 @@ import GetGroupMemberInfo from './GetGroupMemberInfo'
import SendGroupMsg from './SendGroupMsg'
import SendPrivateMsg from './SendPrivateMsg'
import SendMsg from './SendMsg'
import DeleteMsg from "./DeleteMsg";
export const actionHandlers = [
new GetMsg(),
new GetLoginInfo(),
new GetFriendList(),
new GetGroupList(), new GetGroupInfo(), new GetGroupMemberList(), new GetGroupMemberInfo(),
new SendGroupMsg(), new SendPrivateMsg(), new SendMsg()
new SendGroupMsg(), new SendPrivateMsg(), new SendMsg(),
new DeleteMsg()
]