MCPcopy Create free account
hub / github.com/LagrangeDev/LagrangeGo / GetUID

Method GetUID

client/cache.go:10–32  ·  view source on GitHub ↗

GetUID 获取缓存中对应uin的uid

(uin uint32, groupUin ...uint32)

Source from the content-addressed store, hash-verified

8
9// GetUID 获取缓存中对应uin的uid
10func (c *QQClient) GetUID(uin uint32, groupUin ...uint32) string {
11 if uin == 0 {
12 return ""
13 }
14 if len(groupUin) == 0 && c.cache.FriendCacheIsEmpty() {
15 if err := c.RefreshFriendCache(); err != nil {
16 return ""
17 }
18 } else if len(groupUin) != 0 && c.cache.GroupMemberCacheIsEmpty(groupUin[0]) {
19 if err := c.RefreshGroupMembersCache(groupUin[0]); err != nil {
20 return ""
21 }
22 }
23 if uid := c.cache.GetUID(uin, groupUin...); uid != "" {
24 return uid
25 }
26 if len(groupUin) == 0 {
27 _ = c.RefreshFriendCache()
28 } else {
29 _ = c.RefreshGroupMembersCache(groupUin[0])
30 }
31 return c.cache.GetUID(uin, groupUin...)
32}
33
34// GetUin 获取缓存中对应的uin
35func (c *QQClient) GetUin(uid string, groupUin ...uint32) uint32 {

Callers 15

SendGroupMessageMethod · 0.95
SendPrivateMessageMethod · 0.95
SendTempMessageMethod · 0.95
BuildFakeMessageMethod · 0.95
UploadImageMethod · 0.95
UploadRecordMethod · 0.95
UploadShortVideoMethod · 0.95
UploadPrivateFileMethod · 0.95
FetchGroupMemberMethod · 0.95
SetGroupMemberMuteMethod · 0.95
SetGroupAdminMethod · 0.95

Calls 4

RefreshFriendCacheMethod · 0.95
FriendCacheIsEmptyMethod · 0.80

Tested by

no test coverage detected