[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
|
return err
|
||||||
}
|
}
|
||||||
// 设置当前的用户
|
// 设置当前的用户
|
||||||
b.self = &Self{bot: b, User: &resp.User}
|
b.self = &Self{bot: b, User: resp.User}
|
||||||
b.self.formatEmoji()
|
b.self.formatEmoji()
|
||||||
b.self.self = b.self
|
b.self.self = b.self
|
||||||
|
resp.ContactList.init(b.self)
|
||||||
b.Storage.Response = resp
|
b.Storage.Response = resp
|
||||||
|
|
||||||
// 通知手机客户端已经登录
|
// 通知手机客户端已经登录
|
||||||
|
20
entity.go
20
entity.go
@ -57,9 +57,9 @@ type WebInitResponse struct {
|
|||||||
SKey string
|
SKey string
|
||||||
BaseResponse BaseResponse
|
BaseResponse BaseResponse
|
||||||
SyncKey SyncKey
|
SyncKey SyncKey
|
||||||
User User
|
User *User
|
||||||
MPSubscribeMsgList []MPSubscribeMsg
|
MPSubscribeMsgList []*MPSubscribeMsg
|
||||||
ContactList []User
|
ContactList Members
|
||||||
}
|
}
|
||||||
|
|
||||||
// MPSubscribeMsg 公众号的订阅信息
|
// MPSubscribeMsg 公众号的订阅信息
|
||||||
@ -68,12 +68,14 @@ type MPSubscribeMsg struct {
|
|||||||
Time int64
|
Time int64
|
||||||
UserName string
|
UserName string
|
||||||
NickName string
|
NickName string
|
||||||
MPArticleList []struct {
|
MPArticleList []*MPArticle
|
||||||
Title string
|
}
|
||||||
Cover string
|
|
||||||
Digest string
|
type MPArticle struct {
|
||||||
Url string
|
Title string
|
||||||
}
|
Cover string
|
||||||
|
Digest string
|
||||||
|
Url string
|
||||||
}
|
}
|
||||||
|
|
||||||
type UserDetailItem struct {
|
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...)
|
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 抽象的用户组
|
// Members 抽象的用户组
|
||||||
type Members []*User
|
type Members []*User
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user