From 854f61dda639b622b6e946ce8a4a255a8583a577 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, 23 May 2025 17:22:07 +0800 Subject: [PATCH] feat: createGrayTip --- src/core/apis/group.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/core/apis/group.ts b/src/core/apis/group.ts index 423e1e2d..248ef54a 100644 --- a/src/core/apis/group.ts +++ b/src/core/apis/group.ts @@ -10,6 +10,8 @@ import { GroupNotify, GroupInfoSource, ShutUpGroupMember, + Peer, + ChatType, } from '@/core'; import { isNumeric, solveAsyncProblem } from '@/common/helper'; import { LimitedHashTable } from '@/common/message-unique'; @@ -47,6 +49,22 @@ export class NTQQGroupApi { this.initCache().then().catch(e => this.context.logger.logError(e)); } + async createGrayTip(groupCode: string, tip: string) { + return this.context.session.getMsgService().addLocalJsonGrayTipMsg( + { + chatType: ChatType.KCHATTYPEGROUP, + peerUid: groupCode, + } as Peer, + { + busiId: 2201, + jsonStr: JSON.stringify({ "align": "center", "items": [{ "txt": tip, "type": "nor" }] }), + recentAbstract: tip, + isServer: false + }, + true, + true + ) + } async initCache() { for (const group of await this.getGroups(true)) { this.refreshGroupMemberCache(group.groupCode, false).then().catch(e => this.context.logger.logError(e));