✏️ make lint happy

This commit is contained in:
fumiama
2021-12-24 12:32:51 +08:00
parent a3b5a226ac
commit 7c5d08b723
12 changed files with 43 additions and 34 deletions

View File

@@ -70,7 +70,7 @@ func init() {
keyword := ctx.State["regex_matched"].([]string)[1]
soutujson := soutuapi(keyword)
pom1 := "https://i.pixiv.re"
rannum := randintn(len(soutujson.Illusts))
rannum := rintn(len(soutujson.Illusts))
pom2 := soutujson.Illusts[rannum].ImageUrls.Medium[19:]
ctx.SendChain(message.Image(pom1 + pom2))
})
@@ -102,8 +102,8 @@ func soutuapi(keyword string) *resultjson {
return result
}
// randintn 从json里的30条数据中随机获取一条返回
func randintn(len int) int {
// rintn 从json里的30条数据中随机获取一条返回
func rintn(len int) int {
rand.Seed(time.Now().UnixNano())
return rand.Intn(len)
}