feat: 查看自己所有的对话
This commit is contained in:
@@ -22,6 +22,9 @@ export type CallMethod =
|
||||
// 最近对话列表
|
||||
"User.getMyRecentChats" |
|
||||
|
||||
// 所有对话列表
|
||||
"User.getMyAllChats" |
|
||||
|
||||
// 对话信息
|
||||
"Chat.getInfo" |
|
||||
"Chat.getAnotherUserIdFromPrivate" |
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user