mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-20 06:20:08 +08:00
🐛 fix: b14 decode
This commit is contained in:
parent
7ded2fe13a
commit
a2dfc54068
6
go.mod
6
go.mod
@ -3,15 +3,15 @@ module github.com/FloatTech/ZeroBot-Plugin
|
|||||||
go 1.18
|
go 1.18
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/FloatTech/AnimeAPI v1.4.1-0.20220610072926-7b30ff4586ec
|
github.com/FloatTech/AnimeAPI v1.4.1-0.20220613042537-0adf8c5616ec
|
||||||
github.com/FloatTech/sqlite v0.3.2
|
github.com/FloatTech/sqlite v0.3.2
|
||||||
github.com/FloatTech/zbpctrl v1.4.1-0.20220610074608-425160596f27
|
github.com/FloatTech/zbpctrl v1.4.1-0.20220610074608-425160596f27
|
||||||
github.com/FloatTech/zbputils v1.4.1-0.20220610074642-09004f278b03
|
github.com/FloatTech/zbputils v1.4.1-0.20220613042833-33e22060e8d9
|
||||||
github.com/antchfx/htmlquery v1.2.5
|
github.com/antchfx/htmlquery v1.2.5
|
||||||
github.com/corona10/goimagehash v1.0.3
|
github.com/corona10/goimagehash v1.0.3
|
||||||
github.com/fogleman/gg v1.3.0
|
github.com/fogleman/gg v1.3.0
|
||||||
github.com/fumiama/cron v1.3.0
|
github.com/fumiama/cron v1.3.0
|
||||||
github.com/fumiama/go-base16384 v1.5.2
|
github.com/fumiama/go-base16384 v1.5.3
|
||||||
github.com/fumiama/go-registry v0.1.6
|
github.com/fumiama/go-registry v0.1.6
|
||||||
github.com/fumiama/gofastTEA v0.0.10
|
github.com/fumiama/gofastTEA v0.0.10
|
||||||
github.com/fumiama/gotracemoe v0.0.3
|
github.com/fumiama/gotracemoe v0.0.3
|
||||||
|
|||||||
12
go.sum
12
go.sum
@ -8,14 +8,14 @@ dmitri.shuralyov.com/service/change v0.0.0-20181023043359-a85b471d5412/go.mod h1
|
|||||||
dmitri.shuralyov.com/state v0.0.0-20180228185332-28bcc343414c/go.mod h1:0PRwlb0D6DFvNNtx+9ybjezNCa8XF0xaYcETyp6rHWU=
|
dmitri.shuralyov.com/state v0.0.0-20180228185332-28bcc343414c/go.mod h1:0PRwlb0D6DFvNNtx+9ybjezNCa8XF0xaYcETyp6rHWU=
|
||||||
git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg=
|
git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg=
|
||||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||||
github.com/FloatTech/AnimeAPI v1.4.1-0.20220610072926-7b30ff4586ec h1:10h8e85tJ9v+ZQ+ShFQW4L2KP1x88+ntaZdVt9XHkwE=
|
github.com/FloatTech/AnimeAPI v1.4.1-0.20220613042537-0adf8c5616ec h1:Hl/BxaQoQFEJUIGmdhR0NyBvZChb7qkfCrF916bNxnI=
|
||||||
github.com/FloatTech/AnimeAPI v1.4.1-0.20220610072926-7b30ff4586ec/go.mod h1:z7gyiirY3EMH4QHfymYl21KNanSB2Ni4jwtFp9e/raA=
|
github.com/FloatTech/AnimeAPI v1.4.1-0.20220613042537-0adf8c5616ec/go.mod h1:MrCZ7P6WvF0JWHMeedAx6fVm5BP1s6/RUy0r0Jvqrds=
|
||||||
github.com/FloatTech/sqlite v0.3.2 h1:iTg2ZKnzjjZAdlSN3hXmpCBn15odc4Ud484OoM3yXGA=
|
github.com/FloatTech/sqlite v0.3.2 h1:iTg2ZKnzjjZAdlSN3hXmpCBn15odc4Ud484OoM3yXGA=
|
||||||
github.com/FloatTech/sqlite v0.3.2/go.mod h1:VFtLofV5qxw5eBneZRbWwD451SLSm50o9J3J43iB1iw=
|
github.com/FloatTech/sqlite v0.3.2/go.mod h1:VFtLofV5qxw5eBneZRbWwD451SLSm50o9J3J43iB1iw=
|
||||||
github.com/FloatTech/zbpctrl v1.4.1-0.20220610074608-425160596f27 h1:C+D30vpxfgbJetTFXWAHzuU8GydbFb/A8Kv6E3PdRS4=
|
github.com/FloatTech/zbpctrl v1.4.1-0.20220610074608-425160596f27 h1:C+D30vpxfgbJetTFXWAHzuU8GydbFb/A8Kv6E3PdRS4=
|
||||||
github.com/FloatTech/zbpctrl v1.4.1-0.20220610074608-425160596f27/go.mod h1:5FDkrlVaQCxUfeqH7XJPTfej0q+y9fzImhvZI4ofu9Y=
|
github.com/FloatTech/zbpctrl v1.4.1-0.20220610074608-425160596f27/go.mod h1:5FDkrlVaQCxUfeqH7XJPTfej0q+y9fzImhvZI4ofu9Y=
|
||||||
github.com/FloatTech/zbputils v1.4.1-0.20220610074642-09004f278b03 h1:OeVhJvlf3gMac+B5CMOQoJOM3I/uz/wCMgX6o6OgtFE=
|
github.com/FloatTech/zbputils v1.4.1-0.20220613042833-33e22060e8d9 h1:IeUs08sUqdR/g8DfxPNTSBfsE1g0OtmffLNgKzbrVZ4=
|
||||||
github.com/FloatTech/zbputils v1.4.1-0.20220610074642-09004f278b03/go.mod h1:6Y34s+MbssTT4AWBKfJCMifFyFhtB3RGC1qo+8EVGZ4=
|
github.com/FloatTech/zbputils v1.4.1-0.20220613042833-33e22060e8d9/go.mod h1:A9AeVHZsv5chyw8p4fDI0cHnEOfMpmsTLoLWqUT7TO4=
|
||||||
github.com/PuerkitoBio/goquery v1.5.1/go.mod h1:GsLWisAFVj4WgDibEWF4pvYnkVQBpKBKeU+7zCJoLcc=
|
github.com/PuerkitoBio/goquery v1.5.1/go.mod h1:GsLWisAFVj4WgDibEWF4pvYnkVQBpKBKeU+7zCJoLcc=
|
||||||
github.com/RomiChan/syncx v0.0.0-20220404072119-d7ea0ae15a4c h1:cNPOdTNiVwxLpROLjXCgbIPvdkE+BwvxDvgmdYmWx6Q=
|
github.com/RomiChan/syncx v0.0.0-20220404072119-d7ea0ae15a4c h1:cNPOdTNiVwxLpROLjXCgbIPvdkE+BwvxDvgmdYmWx6Q=
|
||||||
github.com/RomiChan/syncx v0.0.0-20220404072119-d7ea0ae15a4c/go.mod h1:KqZzu7slNKROh3TSYEH/IUMG6f4M+1qubZ5e52QypsE=
|
github.com/RomiChan/syncx v0.0.0-20220404072119-d7ea0ae15a4c/go.mod h1:KqZzu7slNKROh3TSYEH/IUMG6f4M+1qubZ5e52QypsE=
|
||||||
@ -57,8 +57,8 @@ github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWo
|
|||||||
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
|
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
|
||||||
github.com/fumiama/cron v1.3.0 h1:ZWlwuexF+HQHl3cYytEE5HNwD99q+3vNZF1GrEiXCFo=
|
github.com/fumiama/cron v1.3.0 h1:ZWlwuexF+HQHl3cYytEE5HNwD99q+3vNZF1GrEiXCFo=
|
||||||
github.com/fumiama/cron v1.3.0/go.mod h1:bz5Izvgi/xEUI8tlBN8BI2jr9Moo8N4or0KV8xXuPDY=
|
github.com/fumiama/cron v1.3.0/go.mod h1:bz5Izvgi/xEUI8tlBN8BI2jr9Moo8N4or0KV8xXuPDY=
|
||||||
github.com/fumiama/go-base16384 v1.5.2 h1:cbxXTcDH92PNgG7bEBwiCEoWb5O+nwZKxKOG94ilFo8=
|
github.com/fumiama/go-base16384 v1.5.3 h1:IUZUlm2ajJB1nEJzauP6yD5IeJoVHyBEkzKJf9O82zs=
|
||||||
github.com/fumiama/go-base16384 v1.5.2/go.mod h1:OEn+947GV5gsbTAnyuUW/SrfxJYUdYupSIQXOuGOcXM=
|
github.com/fumiama/go-base16384 v1.5.3/go.mod h1:OEn+947GV5gsbTAnyuUW/SrfxJYUdYupSIQXOuGOcXM=
|
||||||
github.com/fumiama/go-registry v0.1.6 h1:Ee/tXCCIR/xt8celhbbw0W/xDMdhAXLwy2YFBB/LWFk=
|
github.com/fumiama/go-registry v0.1.6 h1:Ee/tXCCIR/xt8celhbbw0W/xDMdhAXLwy2YFBB/LWFk=
|
||||||
github.com/fumiama/go-registry v0.1.6/go.mod h1:dIUVbiOgfk9oZcsgwDvNLC72i+ctibVukSXR/9bLviI=
|
github.com/fumiama/go-registry v0.1.6/go.mod h1:dIUVbiOgfk9oZcsgwDvNLC72i+ctibVukSXR/9bLviI=
|
||||||
github.com/fumiama/gofastTEA v0.0.10 h1:JJJ+brWD4kie+mmK2TkspDXKzqq0IjXm89aGYfoGhhQ=
|
github.com/fumiama/gofastTEA v0.0.10 h1:JJJ+brWD4kie+mmK2TkspDXKzqq0IjXm89aGYfoGhhQ=
|
||||||
|
|||||||
@ -88,7 +88,7 @@ func init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
engine.OnRegex(`^设置语音模式(.*)$`, ctxext.FirstValueInList(t)).SetBlock(true).
|
engine.OnRegex(`^设置语音模式(.*)$`, ctxext.ValueInList(func(ctx *zero.Ctx) string { return ctx.State["regex_matched"].([]string)[1] }, t)).SetBlock(true).
|
||||||
Handle(func(ctx *zero.Ctx) {
|
Handle(func(ctx *zero.Ctx) {
|
||||||
param := ctx.State["regex_matched"].([]string)[1]
|
param := ctx.State["regex_matched"].([]string)[1]
|
||||||
err := t.setSoundMode(ctx, param)
|
err := t.setSoundMode(ctx, param)
|
||||||
@ -98,7 +98,7 @@ func init() {
|
|||||||
}
|
}
|
||||||
ctx.SendChain(message.Reply(ctx.Event.MessageID), message.Text("设置成功,当前模式为", param))
|
ctx.SendChain(message.Reply(ctx.Event.MessageID), message.Text("设置成功,当前模式为", param))
|
||||||
})
|
})
|
||||||
engine.OnRegex(`^设置默认语音模式(.*)$`, ctxext.FirstValueInList(t)).SetBlock(true).
|
engine.OnRegex(`^设置默认语音模式(.*)$`, ctxext.ValueInList(func(ctx *zero.Ctx) string { return ctx.State["regex_matched"].([]string)[1] }, t)).SetBlock(true).
|
||||||
Handle(func(ctx *zero.Ctx) {
|
Handle(func(ctx *zero.Ctx) {
|
||||||
param := ctx.State["regex_matched"].([]string)[1]
|
param := ctx.State["regex_matched"].([]string)[1]
|
||||||
t.setDefaultSoundMode(param)
|
t.setDefaultSoundMode(param)
|
||||||
|
|||||||
@ -139,7 +139,7 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 随机获取签文
|
// 随机获取签文
|
||||||
randtextindex := ctxext.RandSenderPerDayN(ctx, len(omikujis))
|
randtextindex := ctxext.RandSenderPerDayN(ctx.Event.UserID, len(omikujis))
|
||||||
title, text := omikujis[randtextindex]["title"], omikujis[randtextindex]["content"]
|
title, text := omikujis[randtextindex]["title"], omikujis[randtextindex]["content"]
|
||||||
digest := md5.Sum(helper.StringToBytes(zipfile + strconv.Itoa(index) + title + text))
|
digest := md5.Sum(helper.StringToBytes(zipfile + strconv.Itoa(index) + title + text))
|
||||||
cachefile := cache + hex.EncodeToString(digest[:])
|
cachefile := cache + hex.EncodeToString(digest[:])
|
||||||
@ -171,7 +171,7 @@ func randimage(path string, ctx *zero.Ctx) (im image.Image, index int, err error
|
|||||||
}
|
}
|
||||||
defer reader.Close()
|
defer reader.Close()
|
||||||
|
|
||||||
file := reader.File[ctxext.RandSenderPerDayN(ctx, len(reader.File))]
|
file := reader.File[ctxext.RandSenderPerDayN(ctx.Event.UserID, len(reader.File))]
|
||||||
f, err := file.Open()
|
f, err := file.Open()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
|
|||||||
@ -42,7 +42,7 @@ func init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
engine.OnRegex(`^本地(.*)$`, ctxext.FirstValueInList(ns)).SetBlock(true).
|
engine.OnRegex(`^本地(.*)$`, ctxext.ValueInList(func(ctx *zero.Ctx) string { return ctx.State["regex_matched"].([]string)[1] }, ns)).SetBlock(true).
|
||||||
Handle(func(ctx *zero.Ctx) {
|
Handle(func(ctx *zero.Ctx) {
|
||||||
imgtype := ctx.State["regex_matched"].([]string)[1]
|
imgtype := ctx.State["regex_matched"].([]string)[1]
|
||||||
sc := new(setuclass)
|
sc := new(setuclass)
|
||||||
@ -63,7 +63,7 @@ func init() {
|
|||||||
ctx.SendChain(message.Text(imgtype, ": ", sc.Name, "\n"), message.Image(p))
|
ctx.SendChain(message.Text(imgtype, ": ", sc.Name, "\n"), message.Image(p))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
engine.OnRegex(`^刷新本地(.*)$`, ctxext.FirstValueInList(ns), zero.SuperUserPermission).SetBlock(true).
|
engine.OnRegex(`^刷新本地(.*)$`, ctxext.ValueInList(func(ctx *zero.Ctx) string { return ctx.State["regex_matched"].([]string)[1] }, ns), zero.SuperUserPermission).SetBlock(true).
|
||||||
Handle(func(ctx *zero.Ctx) {
|
Handle(func(ctx *zero.Ctx) {
|
||||||
imgtype := ctx.State["regex_matched"].([]string)[1]
|
imgtype := ctx.State["regex_matched"].([]string)[1]
|
||||||
err := ns.scanclass(os.DirFS(setupath), imgtype, imgtype)
|
err := ns.scanclass(os.DirFS(setupath), imgtype, imgtype)
|
||||||
|
|||||||
@ -28,7 +28,7 @@ func init() { // 插件主体
|
|||||||
|
|
||||||
engine.OnFullMatchGroup([]string{"求签", "占卜"}).SetBlock(true).
|
engine.OnFullMatchGroup([]string{"求签", "占卜"}).SetBlock(true).
|
||||||
Handle(func(ctx *zero.Ctx) {
|
Handle(func(ctx *zero.Ctx) {
|
||||||
i := ctxext.RandSenderPerDayN(ctx, 100) + 1
|
i := ctxext.RandSenderPerDayN(ctx.Event.UserID, 100) + 1
|
||||||
ctx.SendChain(
|
ctx.SendChain(
|
||||||
message.At(ctx.Event.UserID),
|
message.At(ctx.Event.UserID),
|
||||||
message.Image(fmt.Sprintf(bed, i, 0)),
|
message.Image(fmt.Sprintf(bed, i, 0)),
|
||||||
@ -65,7 +65,7 @@ func init() { // 插件主体
|
|||||||
Handle(func(ctx *zero.Ctx) {
|
Handle(func(ctx *zero.Ctx) {
|
||||||
kujiBytes, err := text.RenderToBase64(
|
kujiBytes, err := text.RenderToBase64(
|
||||||
getKujiByBango(
|
getKujiByBango(
|
||||||
uint8(ctxext.RandSenderPerDayN(ctx, 100)+1),
|
uint8(ctxext.RandSenderPerDayN(ctx.Event.UserID, 100)+1),
|
||||||
),
|
),
|
||||||
text.FontFile, 400, 20,
|
text.FontFile, 400, 20,
|
||||||
)
|
)
|
||||||
|
|||||||
@ -78,7 +78,7 @@ func init() { // 插件主体
|
|||||||
return true
|
return true
|
||||||
})
|
})
|
||||||
|
|
||||||
engine.OnRegex(`^来份(.+)$`, getdb, ctxext.FirstValueInList(pool)).SetBlock(true).Limit(ctxext.LimitByUser).
|
engine.OnRegex(`^来份(.+)$`, getdb, ctxext.ValueInList(func(ctx *zero.Ctx) string { return ctx.State["regex_matched"].([]string)[1] }, pool)).SetBlock(true).Limit(ctxext.LimitByUser).
|
||||||
Handle(func(ctx *zero.Ctx) {
|
Handle(func(ctx *zero.Ctx) {
|
||||||
var imgtype = ctx.State["regex_matched"].([]string)[1]
|
var imgtype = ctx.State["regex_matched"].([]string)[1]
|
||||||
// 补充池子
|
// 补充池子
|
||||||
@ -112,7 +112,7 @@ func init() { // 插件主体
|
|||||||
ctx.SendChain(message.Text("成功向分类", imgtype, "添加图片", id))
|
ctx.SendChain(message.Text("成功向分类", imgtype, "添加图片", id))
|
||||||
})
|
})
|
||||||
|
|
||||||
engine.OnRegex(`^删除\s*([^0-9\s]+)\s*(\d+)$`, getdb, ctxext.FirstValueInList(pool), zero.SuperUserPermission).SetBlock(true).
|
engine.OnRegex(`^删除\s*([^0-9\s]+)\s*(\d+)$`, getdb, ctxext.ValueInList(func(ctx *zero.Ctx) string { return ctx.State["regex_matched"].([]string)[1] }, pool), zero.SuperUserPermission).SetBlock(true).
|
||||||
Handle(func(ctx *zero.Ctx) {
|
Handle(func(ctx *zero.Ctx) {
|
||||||
var (
|
var (
|
||||||
imgtype = ctx.State["regex_matched"].([]string)[1]
|
imgtype = ctx.State["regex_matched"].([]string)[1]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user