feat: new api

This commit is contained in:
手瓜一十雪
2024-07-20 17:33:26 +08:00
parent 7a581066c2
commit 80c59de545
7 changed files with 36 additions and 9 deletions

View File

@@ -34,7 +34,7 @@ import SetGroupAdmin from './group/SetGroupAdmin';
import SetGroupCard from './group/SetGroupCard';
import GetImage from './file/GetImage';
import GetRecord from './file/GetRecord';
import { GoCQHTTPMarkMsgAsRead, MarkGroupMsgAsRead, MarkPrivateMsgAsRead } from './msg/MarkMsgAsRead';
import { GoCQHTTPMarkMsgAsRead, MarkAllMsgAsRead, MarkGroupMsgAsRead, MarkPrivateMsgAsRead } from './msg/MarkMsgAsRead';
import CleanCache from './system/CleanCache';
import GoCQHTTPUploadGroupFile from './go-cqhttp/UploadGroupFile';
import { GetConfigAction, SetConfigAction } from '@/onebot11/action/extends/Config';
@@ -153,7 +153,8 @@ export const actionHandlers = [
new GetGroupSystemMsg(),
new DelEssenceMsg(),
new SetEssenceMsg(),
new GetRecentContact()
new GetRecentContact(),
new MarkAllMsgAsRead()
];
function initActionMap() {

View File

@@ -60,3 +60,12 @@ export class GoCQHTTPMarkMsgAsRead extends BaseAction<Payload, null> {
return null;
}
}
export class MarkAllMsgAsRead extends BaseAction<Payload, null> {
actionName = ActionName._MarkAllMsgAsRead;
protected async _handle(payload: Payload): Promise<null> {
await NTQQMsgApi.markallMsgAsRead();
return null;
}
}

View File

@@ -96,5 +96,6 @@ export enum ActionName {
SetLongNick = 'set_self_longnick',
SetEssenceMsg = "set_essence_msg",
DelEssenceMsg = "delete_essence_msg",
GetRecentContact = "get_recent_contact"
GetRecentContact = "get_recent_contact",
_MarkAllMsgAsRead = "_mark_all_as_read"
}