diff --git a/src/onebot11/action/group/GetGroupNotice.ts b/src/onebot11/action/group/GetGroupNotice.ts index 8e8797ce..ecb572ea 100644 --- a/src/onebot11/action/group/GetGroupNotice.ts +++ b/src/onebot11/action/group/GetGroupNotice.ts @@ -1,12 +1,23 @@ -import { WebApi, WebApiGroupNoticeRet } from '@/core/apis/webapi'; +import { WebApi, WebApiGroupNoticeFeed, WebApiGroupNoticeRet } from '@/core/apis/webapi'; import BaseAction from '../BaseAction'; import { ActionName } from '../types'; interface PayloadType { - group_id: number + group_id: number } - -export class GetGroupNotice extends BaseAction { +interface GroupNotice { + sender_id: number + publish_time: number + message: { + text: string + image: Array<{ + height: string + width: string + id: string + }> + } +} +export class GetGroupNotice extends BaseAction { actionName = ActionName.GoCQHTTP_GetGroupNotice; protected async _handle(payload: PayloadType) { @@ -15,6 +26,19 @@ export class GetGroupNotice extends BaseAction(); + for (let key in ret.feeds) { + let retNotice: GroupNotice = { + sender_id: ret.feeds[key].u, + publish_time: ret.feeds[key].pubt, + message: { + text: ret.feeds[key].msg.text, + image: [] + } + } + retNotices.push(retNotice); + } + + return retNotices; } } \ No newline at end of file