Files
NapCatQQ/src/onebot11/action/group/GetGroupNotice.ts
T
2024-04-28 20:30:53 +08:00

20 lines
599 B
TypeScript

import { WebApi, WebApiGroupNoticeRet } from '@/core/apis/webapi';
import BaseAction from '../BaseAction';
import { ActionName } from '../types';
interface PayloadType {
group_id: number
}
export class GetGroupNotice extends BaseAction<PayloadType, WebApiGroupNoticeRet> {
actionName = ActionName.GoCQHTTP_GetGroupNotice;
protected async _handle(payload: PayloadType) {
const group = payload.group_id.toString();
let ret = await WebApi.getGrouptNotice(group);
if (!ret) {
throw new Error('获取公告失败');
}
return ret;
}
}