feat: 查看自己所有的对话

This commit is contained in:
CrescentLeaf
2025-11-23 12:32:59 +08:00
parent 98132eb67c
commit 59191cc42e
9 changed files with 224 additions and 3 deletions

View File

@@ -22,6 +22,9 @@ export type CallMethod =
// 最近对话列表
"User.getMyRecentChats" |
// 所有对话列表
"User.getMyAllChats" |
// 对话信息
"Chat.getInfo" |
"Chat.getAnotherUserIdFromPrivate" |

View File

@@ -177,4 +177,24 @@ export default class UserMySelf extends User {
return re.data!.recent_chats as RecentChatBean[]
throw new CallbackError(re)
}
/*
* ================================================
* 所有对话
* ================================================
*/
async getMyAllChatBeans() {
try {
return await this.getMyAllChatBeansOrThrow()
} catch (_) {
return []
}
}
async getMyAllChatBeansOrThrow() {
const re = await this.client.invoke("User.getMyAllChats", {
token: this.client.access_token
})
if (re.code == 200)
return re.data!.all_chats as ChatBean[]
throw new CallbackError(re)
}
}