mirror of
https://github.com/LLOneBot/LLOneBot.git
synced 2024-11-22 01:56:33 +00:00
22 lines
574 B
TypeScript
22 lines
574 B
TypeScript
import {ActionName} from "./types";
|
|
import BaseAction from "./BaseAction";
|
|
import {NTQQApi} from "../../ntqqapi/ntcall";
|
|
import {dbUtil} from "../../common/db";
|
|
|
|
interface Payload {
|
|
message_id: number
|
|
}
|
|
|
|
class DeleteMsg extends BaseAction<Payload, void> {
|
|
actionName = ActionName.DeleteMsg
|
|
|
|
protected async _handle(payload: Payload) {
|
|
let msg = await dbUtil.getMsgByShortId(payload.message_id)
|
|
await NTQQApi.recallMsg({
|
|
chatType: msg.chatType,
|
|
peerUid: msg.peerUid
|
|
}, [msg.msgId])
|
|
}
|
|
}
|
|
|
|
export default DeleteMsg |