Skip to content

Commit

Permalink
fix(niuniu): 一些小问题 (#1043)
Browse files Browse the repository at this point in the history
  • Loading branch information
xyy0411 authored Oct 21, 2024
1 parent 814fa0c commit eb065e1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion plugin/niuniu/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,10 +289,10 @@ func init() {
dajiaoLimiter.Delete(fmt.Sprintf("%d_%d", gid, uid))
return
}

messages, err := niuniu.processNiuNiuAction(t, fiancee[1])
if err != nil {
ctx.SendChain(message.Text(err))
dajiaoLimiter.Delete(fmt.Sprintf("%d_%d", gid, uid))
return
}
if err = db.insertNiuNiu(&niuniu, gid); err != nil {
Expand Down Expand Up @@ -375,6 +375,7 @@ func init() {
fencingResult, err := myniuniu.processJJuAction(&adduserniuniu, t, fiancee[1])
if err != nil {
ctx.SendChain(message.Text(err))
jjLimiter.Delete(t)
return
}

Expand Down
8 changes: 4 additions & 4 deletions plugin/niuniu/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ func (u *userInfo) processNiuNiuAction(t string, props string) (string, error) {
load, ok := prop.Load(t)
info = *u
if props != "" {
if !contains(t, dajiaoProp) {
return "", errors.New("道具不能混着用哦")
if contains(t, dajiaoProp) {
return "", errors.New("道具不存在")
}
if err = u.createUserInfoByProps(props); err != nil {
return "", err
Expand Down Expand Up @@ -221,8 +221,8 @@ func (u *userInfo) processJJuAction(adduserniuniu *userInfo, t string, props str
v, ok := prop.Load(t)
info = *u
if props != "" {
if !contains(t, jjProp) {
return "", errors.New("道具不能混着用哦")
if contains(t, jjProp) {
return "", errors.New("道具不存在")
}
if err = u.createUserInfoByProps(props); err != nil {
return "", err
Expand Down

0 comments on commit eb065e1

Please sign in to comment.