✏️ 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

@@ -1,3 +1,4 @@
// Package wtf 鬼东西
package wtf
import (
@@ -27,7 +28,6 @@ func init() {
s := ""
for i, w := range table {
s += fmt.Sprintf("%02d. %s\n", i, w.name)
i++
}
ctx.SendChain(message.Text(s))
})
@@ -43,7 +43,7 @@ func init() {
ctx.SendChain(message.Text("ERROR: ", err))
return
}
w := NewWtf(i)
w := newWtf(i)
if w == nil {
ctx.SendChain(message.Text("没有这项内容!"))
return
@@ -58,9 +58,9 @@ func init() {
name = ctx.Event.Sender.NickName
var text string
if secondname != "" {
text, err = w.Predict(name, secondname)
text, err = w.predict(name, secondname)
} else {
text, err = w.Predict(name)
text, err = w.predict(name)
}
if err != nil {
ctx.SendChain(message.Text("ERROR: ", err))

View File

@@ -18,12 +18,12 @@ for(i=0; i<a.length; i++) {
const apiprefix = "https://wtf.hiigara.net/api/run/"
type Wtf struct {
type wtf struct {
name string
path string
}
var table = [...]*Wtf{
var table = [...]*wtf{
{"你的意义是什么?", "mRIFuS"},
{"【ABO】性別和信息素", "KXyy9"},
{"测测cp", "ZoGXQd"},
@@ -114,7 +114,7 @@ var table = [...]*Wtf{
{"你的蘿莉控程度全國排名", "IIWh9k"},
}
func NewWtf(index int) *Wtf {
func newWtf(index int) *wtf {
if index >= 0 && index < len(table) {
return table[index]
}
@@ -128,7 +128,7 @@ type result struct {
Msg string `json:"msg"`
}
func (w *Wtf) Predict(names ...string) (string, error) {
func (w *wtf) predict(names ...string) (string, error) {
name := ""
for _, n := range names {
name += "/" + url.QueryEscape(n)