From dd88e8d1b8e810175addef2b09680f6d1ec310f9 Mon Sep 17 00:00:00 2001 From: CrescentLeaf Date: Sat, 20 Sep 2025 20:58:20 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=B7=BB=E5=8A=A0=20ChatApi=20?= =?UTF-8?q?=E6=B3=A8=E9=87=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/api/ChatApi.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/server/api/ChatApi.ts b/server/api/ChatApi.ts index d33e3f9..df62104 100644 --- a/server/api/ChatApi.ts +++ b/server/api/ChatApi.ts @@ -9,6 +9,11 @@ export default class ChatApi extends BaseApi { return "Chat" } override onInit(): void { + /** + * 獲取對話訊息 + * @param token 令牌 + * @param target 目標對話 + */ this.registerEvent("Chat.getInfo", (args) => { if (this.checkArgsMissing(args, ['token', 'target'])) return { msg: "參數缺失", @@ -47,6 +52,12 @@ export default class ChatApi extends BaseApi { msg: "not implmented", } }) + /** + * 發送訊息 + * @param token 令牌 + * @param target 目標對話 + * @param + */ this.registerEvent("Chat.sendMessage", (args) => { if (this.checkArgsMissing(args, ['token', 'target'])) return { msg: "參數缺失", @@ -64,6 +75,12 @@ export default class ChatApi extends BaseApi { msg: "未實現", } }) + /** + * 拉取歷史訊息 + * @param token 令牌 + * @param target 目標對話 + * @param page 頁面 + */ this.registerEvent("Chat.getMessageHistory", (args) => { if (this.checkArgsMissing(args, ['token', 'target'])) return { msg: "參數缺失",