mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-22 16:20:08 +08:00
💩👌 make lint happy
This commit is contained in:
parent
bf78603d19
commit
58bc1758ec
@ -65,9 +65,10 @@ func init() {
|
||||
})
|
||||
|
||||
// 逆天
|
||||
// \u200b 是 🥵 的转义
|
||||
zero.OnFullMatch("发大病", zero.OnlyToMe).
|
||||
Handle(func(ctx *zero.Ctx) {
|
||||
ctx.Send("贝拉抽我🥵嘉然骑在我背上🥵晚晚踩我🥵乃琳坐在王座是用看垃圾的眼神看我🥵🥵珈乐踢我🥵🥵,把我眼睛蒙住然后五只脚一起踩我🥵还让我猜脚是谁的,猜错了给我劈眼一铁棍🥵")
|
||||
ctx.Send("贝拉抽我\u200b嘉然骑在我背上\u200b晚晚踩我\u200b乃琳坐在王座是用看垃圾的眼神看我\u200b\u200b珈乐踢我\u200b\u200b,把我眼睛蒙住然后五只脚一起踩我\u200b还让我猜脚是谁的,猜错了给我劈眼一铁棍\u200b")
|
||||
})
|
||||
// 增加小作文
|
||||
zero.OnRegex(`^教你一篇小作文(.*)$`, zero.AdminPermission).
|
||||
|
||||
@ -65,10 +65,10 @@ func init() {
|
||||
}
|
||||
|
||||
// 发起api请求并把返回body交由json库解析
|
||||
func zhiwangapi(Text string) *zhiwang {
|
||||
func zhiwangapi(text string) *zhiwang {
|
||||
|
||||
url := "https://asoulcnki.asia/v1/api/check"
|
||||
post := "{\n\"text\":\"" + Text + "\"\n}"
|
||||
post := "{\n\"text\":\"" + text + "\"\n}"
|
||||
var jsonStr = []byte(post)
|
||||
|
||||
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonStr))
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
// Package imagefinder 关键字搜图
|
||||
package imagefinder
|
||||
|
||||
import (
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
// Package minecraft MCSManager
|
||||
package minecraft
|
||||
|
||||
import (
|
||||
|
||||
@ -150,7 +150,7 @@ func init() { // 插件主体
|
||||
Handle(func(ctx *zero.Ctx) {
|
||||
state := []string{"[SetuTime]"}
|
||||
for i := range pool.List {
|
||||
num, err := pool.DB.num(pool.List[i])
|
||||
num, err := pool.DB.count(pool.List[i])
|
||||
if err != nil {
|
||||
num = 0
|
||||
}
|
||||
@ -193,10 +193,11 @@ func (p *imgpool) size(imgtype string) int {
|
||||
return len(p.Pool[imgtype])
|
||||
}
|
||||
|
||||
/*
|
||||
// isFull 返回缓冲池指定类型是否已满
|
||||
func (p *imgpool) isFull(imgtype string) bool {
|
||||
return len(p.Pool[imgtype]) >= p.Max
|
||||
}
|
||||
}*/
|
||||
|
||||
// push 向缓冲池插入一张图片
|
||||
func (p *imgpool) push(imgtype string, illust *pixiv.Illust) {
|
||||
|
||||
@ -125,6 +125,9 @@ func (db *sqlite) find(table string, objptr interface{}, condition string) (err
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if rows.Err() != nil {
|
||||
return rows.Err()
|
||||
}
|
||||
defer rows.Close()
|
||||
|
||||
for rows.Next() {
|
||||
@ -158,9 +161,9 @@ func (db *sqlite) del(table string, condition string) (err error) {
|
||||
return nil
|
||||
}
|
||||
|
||||
// num 查询数据库行数
|
||||
// count 查询数据库行数
|
||||
// 返回行数以及错误
|
||||
func (db *sqlite) num(table string) (num int, err error) {
|
||||
func (db *sqlite) count(table string) (num int, err error) {
|
||||
var cmd = []string{}
|
||||
cmd = append(cmd, "SELECT * FROM")
|
||||
cmd = append(cmd, table)
|
||||
@ -168,6 +171,9 @@ func (db *sqlite) num(table string) (num int, err error) {
|
||||
if err != nil {
|
||||
return num, err
|
||||
}
|
||||
if rows.Err() != nil {
|
||||
return num, rows.Err()
|
||||
}
|
||||
defer rows.Close()
|
||||
for rows.Next() {
|
||||
num++
|
||||
|
||||
Loading…
Reference in New Issue
Block a user