chore: 添加 ChatApi 注釋

This commit is contained in:
CrescentLeaf
2025-09-20 20:58:20 +08:00
parent eaf0f98058
commit dd88e8d1b8

View File

@@ -9,6 +9,11 @@ export default class ChatApi extends BaseApi {
return "Chat" return "Chat"
} }
override onInit(): void { override onInit(): void {
/**
* 獲取對話訊息
* @param token 令牌
* @param target 目標對話
*/
this.registerEvent("Chat.getInfo", (args) => { this.registerEvent("Chat.getInfo", (args) => {
if (this.checkArgsMissing(args, ['token', 'target'])) return { if (this.checkArgsMissing(args, ['token', 'target'])) return {
msg: "參數缺失", msg: "參數缺失",
@@ -47,6 +52,12 @@ export default class ChatApi extends BaseApi {
msg: "not implmented", msg: "not implmented",
} }
}) })
/**
* 發送訊息
* @param token 令牌
* @param target 目標對話
* @param
*/
this.registerEvent("Chat.sendMessage", (args) => { this.registerEvent("Chat.sendMessage", (args) => {
if (this.checkArgsMissing(args, ['token', 'target'])) return { if (this.checkArgsMissing(args, ['token', 'target'])) return {
msg: "參數缺失", msg: "參數缺失",
@@ -64,6 +75,12 @@ export default class ChatApi extends BaseApi {
msg: "未實現", msg: "未實現",
} }
}) })
/**
* 拉取歷史訊息
* @param token 令牌
* @param target 目標對話
* @param page 頁面
*/
this.registerEvent("Chat.getMessageHistory", (args) => { this.registerEvent("Chat.getMessageHistory", (args) => {
if (this.checkArgsMissing(args, ['token', 'target'])) return { if (this.checkArgsMissing(args, ['token', 'target'])) return {
msg: "參數缺失", msg: "參數缺失",