MCPcopy Create free account
hub / github.com/FloatTech/ZeroBot-Plugin-Playground / addSession

Function addSession

plugin/partygame/sessionAct.go:89–101  ·  view source on GitHub ↗

添加会话

(gid, uid int64, dataPath string)

Source from the content-addressed store, hash-verified

87
88// 添加会话
89func addSession(gid, uid int64, dataPath string) {
90 cls := Session{}
91 cls.GroupID = gid
92 cls.Creator = uid
93 cls.Users = append(cls.Users, uid)
94 cls.IsValid = false
95 cls.Max = 3
96 cls.Cartridges = cls.rotateRoulette()
97 cls.ExpireTime = 300
98 cls.CreateTime = time.Now().Unix()
99
100 saveItem(dataPath, cls)
101}
102
103// 获取参与人数
104func (cls Session) countUser() int {

Callers 1

initFunction · 0.85

Calls 2

rotateRouletteMethod · 0.95
saveItemFunction · 0.85

Tested by

no test coverage detected