From 7cae9829a8eb11dcaaef35a4e106bd304e480242 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=84=86=E9=A5=BC=E5=B9=B2?= Date: Tue, 1 Aug 2023 11:45:05 +0800 Subject: [PATCH] api: _send_group_notice return noticeId (#1834) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 源文雨 <41315874+fumiama@users.noreply.github.com> --- coolq/api.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/coolq/api.go b/coolq/api.go index db8673b..63f1a73 100644 --- a/coolq/api.go +++ b/coolq/api.go @@ -1113,17 +1113,18 @@ func (bot *CQBot) CQSetGroupMemo(groupID int64, msg, img string) global.MSG { if err != nil { return Failed(100, "IMAGE_NOT_FOUND", "图片未找到") } - _, err = bot.Client.AddGroupNoticeWithPic(groupID, msg, data) + noticeID, err := bot.Client.AddGroupNoticeWithPic(groupID, msg, data) if err != nil { return Failed(100, "SEND_NOTICE_ERROR", err.Error()) } + return OK(global.MSG{"notice_id": noticeID}) } else { - _, err := bot.Client.AddGroupNoticeSimple(groupID, msg) + noticeID, err := bot.Client.AddGroupNoticeSimple(groupID, msg) if err != nil { return Failed(100, "SEND_NOTICE_ERROR", err.Error()) } + return OK(global.MSG{"notice_id": noticeID}) } - return OK(nil) } return Failed(100, "GROUP_NOT_FOUND", "群聊不存在") }