From f4a9cc9cdafae876f8492a2c4dfa22063fe18bf7 Mon Sep 17 00:00:00 2001 From: CrescentLeaf Date: Sun, 7 Dec 2025 00:29:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=81=E8=AE=B8=E4=BB=A5=E4=BB=85=E7=94=A8?= =?UTF-8?q?=E4=BA=8E=E8=B0=83=E7=94=A8=E6=96=B9=E6=B3=95=E7=9A=84=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E8=BF=9B=E8=A1=8C=E9=83=A8=E5=88=86=E5=AF=B9=E8=B1=A1?= =?UTF-8?q?=E7=9A=84=E5=AE=9E=E4=BE=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client-protocol/Chat.ts | 5 +++++ client-protocol/User.ts | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/client-protocol/Chat.ts b/client-protocol/Chat.ts index 375bb84..4fc9d1b 100644 --- a/client-protocol/Chat.ts +++ b/client-protocol/Chat.ts @@ -19,6 +19,11 @@ export default class Chat extends BaseClientObject { * 实例化方法 * ================================================ */ + static getForInvokeOnlyById(client: LingChairClient, id: string) { + return new Chat(client, { + id + } as ChatBean) + } static async getById(client: LingChairClient, id: string) { try { return await this.getByIdOrThrow(client, id) diff --git a/client-protocol/User.ts b/client-protocol/User.ts index 216a999..7a1f36c 100644 --- a/client-protocol/User.ts +++ b/client-protocol/User.ts @@ -14,10 +14,15 @@ export default class User extends BaseClientObject { * 实例化方法 * ================================================ */ + static getForInvokeOnlyById(client: LingChairClient, id: string) { + return new User(client, { + id + } as UserBean) + } static async getById(client: LingChairClient, id: string) { try { return await this.getByIdOrThrow(client, id) - } catch(_) { + } catch (_) { return null } }