@@ -106,7 +106,7 @@ func init() {
106106 for {
107107 select {
108108 case <- timer .C :
109- ctx .SendChain (message .At (uid ), message .Text ("超时,已自动取消" ))
109+ ctx .SendChain (message .At (uid ), message .Text (" 超时,已自动取消" ))
110110 return
111111 case r := <- recv :
112112 answer = r .Event .Message .String ()
@@ -122,7 +122,7 @@ func init() {
122122 return
123123 }
124124
125- u , money , err := purchaseItem (n , info )
125+ money , err := purchaseItem (n , info )
126126 if err != nil {
127127 ctx .SendChain (message .Text ("ERROR:" , err ))
128128 return
@@ -138,7 +138,7 @@ func init() {
138138 return
139139 }
140140
141- if err = db .insertNiuNiu (u , gid ); err != nil {
141+ if err = db .insertNiuNiu (& info , gid ); err != nil {
142142 ctx .SendChain (message .Text ("ERROR:" , err ))
143143 return
144144 }
@@ -266,7 +266,7 @@ func init() {
266266 result .WriteString (fmt .Sprintf ("\n 📛%s<%s>的牛牛信息\n ⭕性别:%s\n ⭕%s度:%.2fcm\n ⭕排行:%d\n ⭕%s " ,
267267 ctx .CardOrNickName (uid ), strconv .FormatInt (uid , 10 ),
268268 sex , sexLong , niuniu , niuniuList .ranking (niuniu , uid ), generateRandomString (niuniu )))
269- ctx .SendChain (message .At ( uid ), message . Text (& result ))
269+ ctx .SendChain (message .Text (& result ))
270270 })
271271 en .OnRegex (`^(?:.*使用(.*))??打胶$` , zero .OnlyGroup ,
272272 getdb ).SetBlock (true ).Limit (func (ctx * zero.Ctx ) * rate.Limiter {
@@ -288,22 +288,25 @@ func init() {
288288 t := fmt .Sprintf ("%d_%d" , gid , uid )
289289 fiancee := ctx .State ["regex_matched" ].([]string )
290290 updateMap (t , false )
291+
291292 niuniu , err := db .findNiuNiu (gid , uid )
292293 if err != nil {
293294 ctx .SendChain (message .Text ("请先注册牛牛!" ))
294295 dajiaoLimiter .Delete (fmt .Sprintf ("%d_%d" , gid , uid ))
295296 return
296297 }
297- messages , err := processNiuniuAction (t , niuniu , fiancee [1 ])
298+
299+ messages , err := processNiuniuAction (t , & niuniu , fiancee [1 ])
298300 if err != nil {
299301 ctx .SendChain (message .Text (err ))
300302 return
301303 }
302- ctx .SendChain (message .Text (messages ))
303304 if err = db .insertNiuNiu (& niuniu , gid ); err != nil {
304305 ctx .SendChain (message .Text ("ERROR:" , err ))
305306 return
306307 }
308+
309+ ctx .SendChain (message .Text (messages ))
307310 })
308311 en .OnFullMatch ("注册牛牛" , zero .OnlyGroup , getdb ).SetBlock (true ).Handle (func (ctx * zero.Ctx ) {
309312 gid := ctx .Event .GroupID
@@ -375,7 +378,7 @@ func init() {
375378 jjLimiter .Delete (t )
376379 return
377380 }
378- fencingResult , f1 , err := processJJuAction (myniuniu , adduserniuniu , t , fiancee [1 ])
381+ fencingResult , f1 , err := processJJuAction (& myniuniu , & adduserniuniu , t , fiancee [1 ])
379382 if err != nil {
380383 ctx .SendChain (message .Text (err ))
381384 return
0 commit comments