Skip to content

Commit

Permalink
Merge branch 'FloatTech:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiang-Red authored Mar 11, 2023
2 parents 8fc3145 + e1591c4 commit 0c4621c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions plugin/coser/coser.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ func init() {
return "", err
}
arr := gjson.Get(helper.BytesToString(data), "data.data").Array()
if len(arr) == 0 {
return "", errors.New("data is empty")
}
pic := arr[rand.Intn(len(arr))]
return pic.String(), nil
}, web.GetData, time.Minute)
Expand Down

0 comments on commit 0c4621c

Please sign in to comment.