From d35598a7983d6d2465db3759f67670cd36dd4b9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=89=8B=E7=93=9C=E4=B8=80=E5=8D=81=E9=9B=AA?= Date: Fri, 3 May 2024 14:02:40 +0800 Subject: [PATCH] fix --- src/onebot11/action/group/GetGroupNotice.ts | 34 ++++++++++++++++++--- 1 file changed, 29 insertions(+), 5 deletions(-) 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