From 36e1317792acaf68663135e7a9a1879db0100a8d 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: Sun, 28 Apr 2024 18:32:12 +0800 Subject: [PATCH] fix --- CHANGELOG.md | 2 +- src/onebot11/action/group/GetGroupNotice.ts | 2 +- src/onebot11/action/group/SetGroupNotice.ts | 16 ++++++++++++++++ src/onebot11/action/types.ts | 3 ++- 4 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 src/onebot11/action/group/SetGroupNotice.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b453ce19..d4d374126 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,4 +12,4 @@ 12. 修复群成员加入时间 上次活跃 活跃等级字段 - 影响 API: /get_group_member_info /get_group_member_list 13. 修复视频所需的 ffmpeg 路径不正确导致视频封面和时长获取失败 - 影响 Event/API 14. 支持音乐卡片,需要配置签名服务器地址, `config/onebot11_.json`的`musicSignUrl`字段 - 新增 Feat: Sign Music -15. 支持获取群公告 - 新增 API: /set_online_status +15. 支持获取与设置群公告 - 新增 API: /_send_group_notice /_get_group_notice diff --git a/src/onebot11/action/group/GetGroupNotice.ts b/src/onebot11/action/group/GetGroupNotice.ts index d36c1487c..ea3988751 100644 --- a/src/onebot11/action/group/GetGroupNotice.ts +++ b/src/onebot11/action/group/GetGroupNotice.ts @@ -6,7 +6,7 @@ interface PayloadType { } export class GetGroupNotice extends BaseAction { - actionName = ActionName.GetGroupNotice; + actionName = ActionName.GoCQHTTP_GetGroupNotice; protected async _handle(payload: PayloadType) { const group = payload.group_id.toString(); diff --git a/src/onebot11/action/group/SetGroupNotice.ts b/src/onebot11/action/group/SetGroupNotice.ts new file mode 100644 index 000000000..0bfd37446 --- /dev/null +++ b/src/onebot11/action/group/SetGroupNotice.ts @@ -0,0 +1,16 @@ +import BaseAction from '../BaseAction'; +import { ActionName } from '../types'; + +interface PayloadType { + group_id: number +} + +export class SetGroupNotice extends BaseAction { + actionName = ActionName.GoCQHTTP_SetGroupNotice; + + protected async _handle(payload: PayloadType) { + const group = payload.group_id.toString(); + // WebApi.getGrouptNotice(group); + return null; + } +} \ No newline at end of file diff --git a/src/onebot11/action/types.ts b/src/onebot11/action/types.ts index c57eae6db..9873c2180 100644 --- a/src/onebot11/action/types.ts +++ b/src/onebot11/action/types.ts @@ -53,10 +53,11 @@ export enum ActionName { CleanCache = 'clean_cache', GetCookies = 'get_cookies', // 以下为扩展napcat扩展 - GetGroupNotice = 'get_group_notice', GetRobotUinRange = 'get_robot_uin_range', SetOnlineStatus = 'set_online_status', // 以下为go-cqhttp api + GoCQHTTP_SetGroupNotice = '_send_group_notice', + GoCQHTTP_GetGroupNotice = '_get_group_notice', GoCQHTTP_SendForwardMsg = 'send_forward_msg', GoCQHTTP_SendGroupForwardMsg = 'send_group_forward_msg', GoCQHTTP_SendPrivateForwardMsg = 'send_private_forward_msg',