mirror of
https://github.com/LLOneBot/LLOneBot.git
synced 2024-11-22 01:56:33 +00:00
feat: delete msg
This commit is contained in:
parent
0a8e25c121
commit
edcf3f2592
22
src/onebot11/actions/DeleteMsg.ts
Normal file
22
src/onebot11/actions/DeleteMsg.ts
Normal 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
|
@ -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()
|
||||
]
|
Loading…
x
Reference in New Issue
Block a user