[feat]: 添加最近联系人和公众号文章列表 (#230)
This commit is contained in:
parent
66c4bebd1f
commit
35a348f0af
3
bot.go
3
bot.go
@ -169,9 +169,10 @@ func (b *Bot) WebInit() error {
|
||||
return err
|
||||
}
|
||||
// 设置当前的用户
|
||||
b.self = &Self{bot: b, User: &resp.User}
|
||||
b.self = &Self{bot: b, User: resp.User}
|
||||
b.self.formatEmoji()
|
||||
b.self.self = b.self
|
||||
resp.ContactList.init(b.self)
|
||||
b.Storage.Response = resp
|
||||
|
||||
// 通知手机客户端已经登录
|
||||
|
20
entity.go
20
entity.go
@ -57,9 +57,9 @@ type WebInitResponse struct {
|
||||
SKey string
|
||||
BaseResponse BaseResponse
|
||||
SyncKey SyncKey
|
||||
User User
|
||||
MPSubscribeMsgList []MPSubscribeMsg
|
||||
ContactList []User
|
||||
User *User
|
||||
MPSubscribeMsgList []*MPSubscribeMsg
|
||||
ContactList Members
|
||||
}
|
||||
|
||||
// MPSubscribeMsg 公众号的订阅信息
|
||||
@ -68,12 +68,14 @@ type MPSubscribeMsg struct {
|
||||
Time int64
|
||||
UserName string
|
||||
NickName string
|
||||
MPArticleList []struct {
|
||||
Title string
|
||||
Cover string
|
||||
Digest string
|
||||
Url string
|
||||
}
|
||||
MPArticleList []*MPArticle
|
||||
}
|
||||
|
||||
type MPArticle struct {
|
||||
Title string
|
||||
Cover string
|
||||
Digest string
|
||||
Url string
|
||||
}
|
||||
|
||||
type UserDetailItem struct {
|
||||
|
10
user.go
10
user.go
@ -668,6 +668,16 @@ func (s *Self) SendVideoToGroups(video io.Reader, delay time.Duration, groups ..
|
||||
return s.sendVideoToMembers(video, delay, members...)
|
||||
}
|
||||
|
||||
// ContactList 获取最近的联系人列表
|
||||
func (s *Self) ContactList() Members {
|
||||
return s.Bot().Storage.Response.ContactList
|
||||
}
|
||||
|
||||
// MPSubscribeList 获取部分公众号文章列表
|
||||
func (s *Self) MPSubscribeList() []*MPSubscribeMsg {
|
||||
return s.Bot().Storage.Response.MPSubscribeMsgList
|
||||
}
|
||||
|
||||
// Members 抽象的用户组
|
||||
type Members []*User
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user