mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2026-02-12 18:20:27 +00:00
✏️ make lint happy
This commit is contained in:
@@ -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))
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user