From 874d7da6dd8f6670423110dc2e5668d87c6ed7e8 Mon Sep 17 00:00:00 2001 From: himawari <1156544355@qq.com> Date: Wed, 10 Apr 2024 22:29:42 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E2=9C=A8=20=E6=B7=BB=E5=8A=A0=E4=B8=A4?= =?UTF-8?q?=E4=B8=AAapi=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 72 +++++++++++++-- go.mod | 2 +- go.sum | 4 +- main.go | 2 + plugin/lolimi/lolimi.go | 129 ++++++++++++++++++++++++++ plugin/manager/manager.go | 18 ++++ plugin/yujn/yujn.go | 189 ++++++++++++++++++++++++++++++++++++++ 7 files changed, 405 insertions(+), 11 deletions(-) create mode 100644 plugin/lolimi/lolimi.go create mode 100644 plugin/yujn/yujn.go diff --git a/README.md b/README.md index b6a5390ab6..8d90d1a7c8 100644 --- a/README.md +++ b/README.md @@ -242,6 +242,8 @@ zerobot [-h] [-m] [-n nickname] [-t token] [-u url] [-g url] [-p prefix] [-d|w] - [x] 列出所有提醒 - [x] 翻牌 + + - [x] 赞我 - [x] [开启 | 关闭]入群验证 @@ -959,6 +961,24 @@ print("run[CQ:image,file="+j["img"]+"]") 来份萝莉 ``` + +
+ 桑帛云 API + + `import _ "github.com/FloatTech/ZeroBot-Plugin/plugin/lolimi"` + + - [x] 随机妹子 + + - [x] 随机绕口令 + + - [x] 颜值鉴定[图片] + + - [x] 随机情话 + + - [x] 发病 嘉然 + + - [x] 让[塔菲|嘉然|东雪莲]说我测尼玛 +
MagicPrompt-Stable-Diffusion吟唱提示 @@ -1517,6 +1537,18 @@ print("run[CQ:image,file="+j["img"]+"]") - [x] 团队七阶猜单词 +
+
+ 鬼东西 + + `import _ "github.com/FloatTech/ZeroBot-Plugin/plugin/wtf"` + + - [x] 鬼东西列表 + + - [x] 查询鬼东西[序号][@xxx] + + - 注:由于需要科学,默认注释。 +
一些游戏王插件 @@ -1558,15 +1590,39 @@ print("run[CQ:image,file="+j["img"]+"]")
- 鬼东西 + 遇见API - `import _ "github.com/FloatTech/ZeroBot-Plugin/plugin/wtf"` - - - [x] 鬼东西列表 - - - [x] 查询鬼东西[序号][@xxx] - - - 注:由于需要科学,默认注释。 + `import _ "github.com/FloatTech/ZeroBot-Plugin/plugin/yujn"` + + - [x] 小姐姐视频 + - [x] 小姐姐视频2 + - [x] 黑丝视频 + - [x] 白丝视频 + - [x] 欲梦视频 + - [x] 甜妹视频 + - [x] 双倍快乐 + - [x] 纯情女高 + - [x] 萝莉视频 + - [x] 玉足视频 + - [x] 帅哥视频 + - [x] 热舞视频 + - [x] 吊带视频 + - [x] 汉服视频 + - [x] 极品狱卒 + - [x] 清纯视频 + - [x] 快手变装 + - [x] 抖音变装 + - [x] 萌娃视频 + - [x] 穿搭视频 + - [x] 完美身材 + - [x] 御姐撒娇 + - [x] 绿茶语音 + - [x] 怼人语音 + - [x] 随机骚话 + - [x] 随机污句子 + - [x] 随机美句 + - [x] 土味情话 + - [x] 让[丁真|陈泽|梅西|孙笑川|科比|懒羊羊|胡桃|雫るる]说我测尼玛
diff --git a/go.mod b/go.mod index fb36708e80..137f3adf3f 100644 --- a/go.mod +++ b/go.mod @@ -40,7 +40,7 @@ require ( github.com/sirupsen/logrus v1.9.3 github.com/tidwall/gjson v1.14.4 github.com/wcharczuk/go-chart/v2 v2.1.0 - github.com/wdvxdr1123/ZeroBot v1.7.5-0.20231009162356-57f71b9f5258 + github.com/wdvxdr1123/ZeroBot v1.7.5-0.20240410141841-6970df23ca54 gitlab.com/gomidi/midi/v2 v2.0.25 golang.org/x/image v0.3.0 golang.org/x/sys v0.8.0 diff --git a/go.sum b/go.sum index 90e80142fe..d849af228d 100644 --- a/go.sum +++ b/go.sum @@ -216,8 +216,8 @@ github.com/tklauser/numcpus v0.6.0 h1:kebhY2Qt+3U6RNK7UqpYNA+tJ23IBEGKkB7JQBfDYm github.com/tklauser/numcpus v0.6.0/go.mod h1:FEZLMke0lhOUG6w2JadTzp0a+Nl8PF/GFkQ5UVIcaL4= github.com/wcharczuk/go-chart/v2 v2.1.0 h1:tY2slqVQ6bN+yHSnDYwZebLQFkphK4WNrVwnt7CJZ2I= github.com/wcharczuk/go-chart/v2 v2.1.0/go.mod h1:yx7MvAVNcP/kN9lKXM/NTce4au4DFN99j6i1OwDclNA= -github.com/wdvxdr1123/ZeroBot v1.7.5-0.20231009162356-57f71b9f5258 h1:Q0dKoj9SHrR8WjjlcX+eyYBjQKqBn/x1pdJJO1IIOxQ= -github.com/wdvxdr1123/ZeroBot v1.7.5-0.20231009162356-57f71b9f5258/go.mod h1:y29UIOy0RD3P+0meDNIWRhcJF3jtWPN9xP9hgt/AJAU= +github.com/wdvxdr1123/ZeroBot v1.7.5-0.20240410141841-6970df23ca54 h1:s7k0Pf4RoeCUHe9rlVsg0mqAH3WO7xLMhe9qih/CxnE= +github.com/wdvxdr1123/ZeroBot v1.7.5-0.20240410141841-6970df23ca54/go.mod h1:y29UIOy0RD3P+0meDNIWRhcJF3jtWPN9xP9hgt/AJAU= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yusufpapurcu/wmi v1.2.2 h1:KBNDSne4vP5mbSWnJbO+51IMOXJB67QiYCSBrubbPRg= diff --git a/main.go b/main.go index 29afe0da7c..a39d6d9a2f 100644 --- a/main.go +++ b/main.go @@ -108,6 +108,7 @@ import ( _ "github.com/FloatTech/ZeroBot-Plugin/plugin/juejuezi" // 绝绝子生成器 _ "github.com/FloatTech/ZeroBot-Plugin/plugin/kfccrazythursday" // 疯狂星期四 _ "github.com/FloatTech/ZeroBot-Plugin/plugin/lolicon" // lolicon 随机图片 + _ "github.com/FloatTech/ZeroBot-Plugin/plugin/lolimi" // 桑帛云 API _ "github.com/FloatTech/ZeroBot-Plugin/plugin/magicprompt" // magicprompt吟唱提示 _ "github.com/FloatTech/ZeroBot-Plugin/plugin/mcfish" // 钓鱼模拟器 _ "github.com/FloatTech/ZeroBot-Plugin/plugin/midicreate" // 简易midi音乐制作 @@ -153,6 +154,7 @@ import ( _ "github.com/FloatTech/ZeroBot-Plugin/plugin/wordle" // 猜单词 _ "github.com/FloatTech/ZeroBot-Plugin/plugin/ygo" // 游戏王相关插件 _ "github.com/FloatTech/ZeroBot-Plugin/plugin/ymgal" // 月幕galgame + _ "github.com/FloatTech/ZeroBot-Plugin/plugin/yujn" // 遇见API // _ "github.com/FloatTech/ZeroBot-Plugin/plugin/wtf" // 鬼东西 diff --git a/plugin/lolimi/lolimi.go b/plugin/lolimi/lolimi.go new file mode 100644 index 0000000000..1c3f0aad4f --- /dev/null +++ b/plugin/lolimi/lolimi.go @@ -0,0 +1,129 @@ +// Package lolimi 来源于 https://api.lolimi.cn/ 的接口 +package lolimi + +import ( + "fmt" + "net/url" + "strconv" + + "github.com/FloatTech/floatbox/binary" + "github.com/FloatTech/floatbox/web" + ctrl "github.com/FloatTech/zbpctrl" + "github.com/FloatTech/zbputils/control" + "github.com/FloatTech/zbputils/ctxext" + "github.com/tidwall/gjson" + zero "github.com/wdvxdr1123/ZeroBot" + "github.com/wdvxdr1123/ZeroBot/message" +) + +const ( + lolimiURL = "https://api.lolimi.cn" + jiaranURL = lolimiURL + "/API/yyhc/jr.php?msg=%v&type=2" + tafeiURL = lolimiURL + "/API/yyhc/taf.php?msg=%v&type=2" + dxlURL = lolimiURL + "/API/yyhc/dxl.php?msg=%v&type=2" + raoURL = lolimiURL + "/API/rao/api.php" + yanURL = lolimiURL + "/API/yan/?url=%v" + xjjURL = lolimiURL + "/API/tup/xjj.php" + qingURL = lolimiURL + "/API/qing/api.php" + fabingURL = lolimiURL + "/API/fabing/fb.php?name=%v" +) + +var ( + engine = control.AutoRegister(&ctrl.Options[*zero.Ctx]{ + DisableOnDefault: false, + Brief: "桑帛云 API", + Help: "- 让[塔菲|嘉然|东雪莲]说我测尼玛\n- 随机绕口令\n- 颜值鉴定[图片]\n" + + "- 随机妹子\n- 随机情话\n- 发病 嘉然\n\n说明: 颜值鉴定只能鉴定三次元图片", + }) +) + +func init() { + engine.OnFullMatch("随机妹子").SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { + ctx.SendChain(message.Image(xjjURL)) + }) + engine.OnFullMatch("随机绕口令").SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { + data, err := web.GetData(raoURL) + if err != nil { + ctx.SendChain(message.Text("ERROR: ", err)) + return + } + ctx.SendChain(message.Reply(ctx.Event.MessageID), message.Text(gjson.Get(binary.BytesToString(data), "data.Msg").String())) + }) + engine.OnFullMatch("随机情话").SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { + data, err := web.GetData(qingURL) + if err != nil { + ctx.SendChain(message.Text("ERROR: ", err)) + return + } + ctx.SendChain(message.Reply(ctx.Event.MessageID), message.Text(binary.BytesToString(data))) + }) + engine.OnPrefix(`发病`).SetBlock(true).Handle(func(ctx *zero.Ctx) { + name := ctx.NickName() + data, err := web.GetData(fmt.Sprintf(fabingURL, url.QueryEscape(name))) + if err != nil { + ctx.SendChain(message.Text("ERROR: ", err)) + return + } + ctx.SendChain(message.Reply(ctx.Event.MessageID), message.Text(gjson.Get(binary.BytesToString(data), "data").String())) + }) + engine.OnKeywordGroup([]string{"颜值鉴定"}, zero.MustProvidePicture).SetBlock(true). + Handle(func(ctx *zero.Ctx) { + list := ctx.State["image_url"].([]string) + if len(list) > 0 { + ctx.SendChain(message.Text("少女祈祷中...")) + data, err := web.GetData(fmt.Sprintf(yanURL, url.QueryEscape(list[0]))) + if err != nil { + ctx.SendChain(message.Text("ERROR: ", err)) + return + } + assessment := gjson.Get(binary.BytesToString(data), "data.text").String() + if assessment == "" { + ctx.SendChain(message.Text("ERROR: 请输入正确的图片")) + return + } + text := "评价: " + text += assessment + for i := 0; i <= 2; i++ { + key := gjson.Get(binary.BytesToString(data), "data.grade.key"+strconv.Itoa(i)).String() + score := gjson.Get(binary.BytesToString(data), "data.grade.score"+strconv.Itoa(i)).String() + if key != "" { + text += "\n" + text += key + text += ": " + text += score + } + } + ctx.SendChain(message.Text(text)) + } + }) + engine.OnRegex("^让(塔菲|嘉然|东雪莲)说([\\s\u4e00-\u9fa5\u3040-\u309F\u30A0-\u30FF\\w\\p{P}\u3000-\u303F\uFF00-\uFFEF]+)$").Limit(ctxext.LimitByGroup).Handle(func(ctx *zero.Ctx) { + name := ctx.State["regex_matched"].([]string)[1] + msg := ctx.State["regex_matched"].([]string)[2] + recordURL := "" + switch name { + case "塔菲": + data, err := web.GetData(fmt.Sprintf(tafeiURL, url.QueryEscape(msg))) + if err != nil { + ctx.SendChain(message.Text("ERROR: ", err)) + return + } + recordURL = gjson.Get(binary.BytesToString(data), "music").String() + case "嘉然": + recordURL = fmt.Sprintf(jiaranURL, url.QueryEscape(msg)) + case "东雪莲": + data, err := web.GetData(fmt.Sprintf(dxlURL, url.QueryEscape(msg))) + if err != nil { + ctx.SendChain(message.Text("ERROR: ", err)) + return + } + recordURL = gjson.Get(binary.BytesToString(data), "music").String() + default: + recordURL = fmt.Sprintf(jiaranURL, url.QueryEscape(msg)) + } + if recordURL == "" { + ctx.SendChain(message.Text("ERROR: 语音生成失败")) + return + } + ctx.SendChain(message.Record(recordURL)) + }) +} diff --git a/plugin/manager/manager.go b/plugin/manager/manager.go index d4dcec52a5..5d42750fdd 100644 --- a/plugin/manager/manager.go +++ b/plugin/manager/manager.go @@ -47,6 +47,7 @@ const ( "- 取消在\"cron\"的提醒\n" + "- 列出所有提醒\n" + "- 翻牌\n" + + "- 赞我\n" + "- 设置欢迎语XXX 可选添加 [{at}] [{nickname}] [{avatar}] [{uid}] [{gid}] [{groupname}]\n" + "- 测试欢迎语\n" + "- 设置告别辞 参数同设置欢迎语\n" + @@ -384,6 +385,23 @@ func init() { // 插件主体 ), ) }) + // 给好友点赞 + engine.OnFullMatch("赞我").SetBlock(true).Limit(ctxext.LimitByUser). + Handle(func(ctx *zero.Ctx) { + list := ctx.GetFriendList().Array() + flag := false + for _, v := range list { + if ctx.Event.UserID == v.Get("user_id").Int() { + flag = true + } + } + if !flag { + ctx.SendChain(message.Reply(ctx.Event.MessageID), message.Text("不加好友不给赞!")) + return + } + ctx.SendLike(ctx.Event.UserID, 10) + ctx.SendChain(message.Reply(ctx.Event.MessageID), message.Text("给你赞了10下哦,记得回我~")) + }) // 入群欢迎 engine.OnNotice().SetBlock(false). Handle(func(ctx *zero.Ctx) { diff --git a/plugin/yujn/yujn.go b/plugin/yujn/yujn.go new file mode 100644 index 0000000000..6d37413fbc --- /dev/null +++ b/plugin/yujn/yujn.go @@ -0,0 +1,189 @@ +// Package yujn 来源于 https://api.yujn.cn/ 的接口 +package yujn + +import ( + "fmt" + "net/url" + "strings" + + "github.com/FloatTech/floatbox/binary" + "github.com/FloatTech/floatbox/web" + ctrl "github.com/FloatTech/zbpctrl" + "github.com/FloatTech/zbputils/control" + "github.com/FloatTech/zbputils/ctxext" + "github.com/tidwall/gjson" + zero "github.com/wdvxdr1123/ZeroBot" + "github.com/wdvxdr1123/ZeroBot/message" +) + +const ( + yujnURL = "https://api.yujn.cn" + zzxjjURL = yujnURL + "/api/zzxjj.php?type=video" + baisisURL = yujnURL + "/api/baisis.php?type=video" + heisisURL = yujnURL + "/api/heisis.php?type=video" + xjjURL = yujnURL + "/api/xjj.php?type=video" + tianmeiURL = yujnURL + "/api/tianmei.php?type=video" + ndymURL = yujnURL + "/api/ndym.php?type=video" + sbklURL = yujnURL + "/api/sbkl.php?type=video" + nvgaoURL = yujnURL + "/api/nvgao.php?type=video" + luoliURL = yujnURL + "/api/luoli.php?type=video" + yuzuURL = yujnURL + "/api/yuzu.php?type=video" + xggURL = yujnURL + "/api/xgg.php?type=video" + rewuURL = yujnURL + "/api/rewu.php?type=video" + diaodaiURL = yujnURL + "/api/diaodai.php?type=video" + hanfuURL = yujnURL + "/api/hanfu.php?type=video" + jpyzURL = yujnURL + "/api/jpmt.php?type=video" + qingchunURL = yujnURL + "/api/qingchun.php?type=video" + ksbianzhuang = yujnURL + "/api/ksbianzhuang.php?type=video" + dybianzhuang = yujnURL + "/api/bianzhuang.php?type=video" + mengwaURL = yujnURL + "/api/mengwa.php?type=video" + chuandaURL = yujnURL + "/api/chuanda.php?type=video" + wmscURL = yujnURL + "/api/wmsc.php?type=video" + yujieURL = yujnURL + "/api/yujie.php" + luchaURL = yujnURL + "/api/lvcha.php" + duirenURL = yujnURL + "/api/duiren.php" + saohuaURL = yujnURL + "/api/saohua.php" + qinghuaURL = yujnURL + "/api/qinghua.php" + wuURL = yujnURL + "/api/text_wu.php" + wenanURL = yujnURL + "/api/wenan.php" + yuyinURL = yujnURL + "/api/yuyin.php?type=json&from=%v&msg=%v" +) + +var ( + engine = control.AutoRegister(&ctrl.Options[*zero.Ctx]{ + DisableOnDefault: false, + Brief: "遇见API", + Help: "- 小姐姐视频\n- 小姐姐视频2\n- 黑丝视频\n- 白丝视频\n" + + "- 欲梦视频\n- 甜妹视频\n- 双倍快乐\n- 纯情女高\n" + + "- 萝莉视频\n- 玉足视频\n- 帅哥视频\n- 热舞视频\n" + + "- 吊带视频\n- 汉服视频\n- 极品狱卒\n- 清纯视频\n" + + "- 快手变装\n- 抖音变装\n- 萌娃视频\n- 穿搭视频\n" + + "- 完美身材\n- 御姐撒娇\n- 绿茶语音\n- 怼人语音\n" + + "- 随机骚话\n- 随机污句子\n- 随机美句\n- 土味情话\n- 让[丁真|陈泽|梅西|孙笑川|科比|懒羊羊|胡桃|雫るる]说我测尼玛", + }) +) + +func init() { + engine.OnFullMatchGroup([]string{"小姐姐视频"}).SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { + ctx.SendChain(message.Video(zzxjjURL)) + }) + engine.OnFullMatchGroup([]string{"小姐姐视频2"}).SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { + ctx.SendChain(message.Video(xjjURL)) + }) + engine.OnFullMatch("黑丝视频").SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { + ctx.SendChain(message.Video(heisisURL)) + }) + engine.OnFullMatch("白丝视频").SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { + ctx.SendChain(message.Video(baisisURL)) + }) + engine.OnFullMatch("欲梦视频").SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { + ctx.SendChain(message.Video(ndymURL)) + }) + engine.OnFullMatch("甜妹视频").SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { + ctx.SendChain(message.Video(tianmeiURL)) + }) + engine.OnFullMatch("双倍快乐").SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { + ctx.SendChain(message.Video(sbklURL)) + }) + engine.OnFullMatch("纯情女高").SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { + ctx.SendChain(message.Video(nvgaoURL)) + }) + engine.OnFullMatch("萝莉视频").SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { + ctx.SendChain(message.Video(luoliURL)) + }) + engine.OnFullMatch("玉足视频").SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { + ctx.SendChain(message.Video(yuzuURL)) + }) + engine.OnFullMatch("帅哥视频").SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { + ctx.SendChain(message.Video(xggURL)) + }) + engine.OnFullMatch("热舞视频").SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { + ctx.SendChain(message.Video(rewuURL)) + }) + engine.OnFullMatch("吊带视频").SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { + ctx.SendChain(message.Video(diaodaiURL)) + }) + engine.OnFullMatch("汉服视频").SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { + ctx.SendChain(message.Video(hanfuURL)) + }) + engine.OnFullMatch("极品狱卒").SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { + ctx.SendChain(message.Video(jpyzURL)) + }) + engine.OnFullMatch("清纯视频").SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { + ctx.SendChain(message.Video(qingchunURL)) + }) + engine.OnFullMatch("快手变装").SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { + ctx.SendChain(message.Video(ksbianzhuang)) + }) + engine.OnFullMatch("抖音变装").SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { + ctx.SendChain(message.Video(dybianzhuang)) + }) + engine.OnFullMatch("萌娃视频").SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { + ctx.SendChain(message.Video(mengwaURL)) + }) + engine.OnFullMatch("穿搭视频").SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { + ctx.SendChain(message.Video(chuandaURL)) + }) + engine.OnFullMatch("完美身材").SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { + ctx.SendChain(message.Video(wmscURL)) + }) + engine.OnFullMatch("御姐撒娇").SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { + ctx.SendChain(message.Record(yujieURL)) + }) + engine.OnFullMatch("绿茶语音").SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { + ctx.SendChain(message.Record(luchaURL)) + }) + engine.OnFullMatch("怼人语音").SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { + ctx.SendChain(message.Record(duirenURL)) + }) + engine.OnFullMatch("随机骚话").SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { + data, err := web.GetData(saohuaURL) + if err != nil { + ctx.SendChain(message.Text("ERROR: ", err)) + return + } + ctx.SendChain(message.Reply(ctx.Event.MessageID), message.Text(binary.BytesToString(data))) + }) + engine.OnFullMatch("土味情话").SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { + data, err := web.GetData(qinghuaURL) + if err != nil { + ctx.SendChain(message.Text("ERROR: ", err)) + return + } + ctx.SendChain(message.Reply(ctx.Event.MessageID), message.Text(binary.BytesToString(data))) + }) + engine.OnFullMatch("随机污句子").SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { + data, err := web.GetData(wuURL) + if err != nil { + ctx.SendChain(message.Text("ERROR: ", err)) + return + } + ctx.SendChain(message.Reply(ctx.Event.MessageID), message.Text(binary.BytesToString(data))) + }) + engine.OnFullMatch("随机美句").SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { + data, err := web.GetData(wenanURL) + if err != nil { + ctx.SendChain(message.Text("ERROR: ", err)) + return + } + text := binary.BytesToString(data) + text = strings.ReplaceAll(text, "

", "") + text = strings.ReplaceAll(text, "

", "") + ctx.SendChain(message.Reply(ctx.Event.MessageID), message.Text(text)) + }) + engine.OnRegex("^让(丁真|陈泽|梅西|孙笑川|科比|懒羊羊|胡桃|雫るる)说([\\s\u4e00-\u9fa5\u3040-\u309F\u30A0-\u30FF\\w\\p{P}\u3000-\u303F\uFF00-\uFFEF]+)$").Limit(ctxext.LimitByGroup).Handle(func(ctx *zero.Ctx) { + name := ctx.State["regex_matched"].([]string)[1] + msg := ctx.State["regex_matched"].([]string)[2] + data, err := web.GetData(fmt.Sprintf(yuyinURL, url.QueryEscape(name), url.QueryEscape(msg))) + if err != nil { + ctx.SendChain(message.Text("ERROR: ", err)) + return + } + recordURL := gjson.Get(binary.BytesToString(data), "url").String() + if recordURL == "" { + ctx.SendChain(message.Text("ERROR: 语音生成失败")) + return + } + ctx.SendChain(message.Record(recordURL)) + }) +} From 84fab92f40b074755f88ce1f925aa1daffaeb40a Mon Sep 17 00:00:00 2001 From: himawari <1156544355@qq.com> Date: Thu, 11 Apr 2024 00:39:11 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E2=9C=A8=20=E8=AE=A9=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E7=AE=80=E6=B4=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/lolimi/lolimi.go | 18 ++-- plugin/manager/manager.go | 1 + plugin/yujn/yujn.go | 168 +++++++++++++++++++------------------- 3 files changed, 94 insertions(+), 93 deletions(-) diff --git a/plugin/lolimi/lolimi.go b/plugin/lolimi/lolimi.go index 1c3f0aad4f..97ef42ba72 100644 --- a/plugin/lolimi/lolimi.go +++ b/plugin/lolimi/lolimi.go @@ -5,6 +5,7 @@ import ( "fmt" "net/url" "strconv" + "strings" "github.com/FloatTech/floatbox/binary" "github.com/FloatTech/floatbox/web" @@ -81,19 +82,22 @@ func init() { ctx.SendChain(message.Text("ERROR: 请输入正确的图片")) return } - text := "评价: " - text += assessment + var text strings.Builder // 创建一个strings.Builder实例 + text.WriteString("评价: ") + text.WriteString(assessment) // 添加评估信息 + for i := 0; i <= 2; i++ { key := gjson.Get(binary.BytesToString(data), "data.grade.key"+strconv.Itoa(i)).String() score := gjson.Get(binary.BytesToString(data), "data.grade.score"+strconv.Itoa(i)).String() if key != "" { - text += "\n" - text += key - text += ": " - text += score + text.WriteString("\n") + text.WriteString(key) + text.WriteString(": ") + text.WriteString(score) } } - ctx.SendChain(message.Text(text)) + + ctx.SendChain(message.Text(text.String())) // 发送构建好的字符串 } }) engine.OnRegex("^让(塔菲|嘉然|东雪莲)说([\\s\u4e00-\u9fa5\u3040-\u309F\u30A0-\u30FF\\w\\p{P}\u3000-\u303F\uFF00-\uFFEF]+)$").Limit(ctxext.LimitByGroup).Handle(func(ctx *zero.Ctx) { diff --git a/plugin/manager/manager.go b/plugin/manager/manager.go index 5d42750fdd..6b81376389 100644 --- a/plugin/manager/manager.go +++ b/plugin/manager/manager.go @@ -393,6 +393,7 @@ func init() { // 插件主体 for _, v := range list { if ctx.Event.UserID == v.Get("user_id").Int() { flag = true + break } } if !flag { diff --git a/plugin/yujn/yujn.go b/plugin/yujn/yujn.go index 6d37413fbc..3f1ea91937 100644 --- a/plugin/yujn/yujn.go +++ b/plugin/yujn/yujn.go @@ -64,96 +64,92 @@ var ( ) func init() { - engine.OnFullMatchGroup([]string{"小姐姐视频"}).SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { - ctx.SendChain(message.Video(zzxjjURL)) - }) - engine.OnFullMatchGroup([]string{"小姐姐视频2"}).SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { - ctx.SendChain(message.Video(xjjURL)) - }) - engine.OnFullMatch("黑丝视频").SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { - ctx.SendChain(message.Video(heisisURL)) - }) - engine.OnFullMatch("白丝视频").SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { - ctx.SendChain(message.Video(baisisURL)) - }) - engine.OnFullMatch("欲梦视频").SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { - ctx.SendChain(message.Video(ndymURL)) - }) - engine.OnFullMatch("甜妹视频").SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { - ctx.SendChain(message.Video(tianmeiURL)) - }) - engine.OnFullMatch("双倍快乐").SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { - ctx.SendChain(message.Video(sbklURL)) - }) - engine.OnFullMatch("纯情女高").SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { - ctx.SendChain(message.Video(nvgaoURL)) - }) - engine.OnFullMatch("萝莉视频").SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { - ctx.SendChain(message.Video(luoliURL)) - }) - engine.OnFullMatch("玉足视频").SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { - ctx.SendChain(message.Video(yuzuURL)) - }) - engine.OnFullMatch("帅哥视频").SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { - ctx.SendChain(message.Video(xggURL)) - }) - engine.OnFullMatch("热舞视频").SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { - ctx.SendChain(message.Video(rewuURL)) - }) - engine.OnFullMatch("吊带视频").SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { - ctx.SendChain(message.Video(diaodaiURL)) - }) - engine.OnFullMatch("汉服视频").SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { - ctx.SendChain(message.Video(hanfuURL)) - }) - engine.OnFullMatch("极品狱卒").SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { - ctx.SendChain(message.Video(jpyzURL)) - }) - engine.OnFullMatch("清纯视频").SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { - ctx.SendChain(message.Video(qingchunURL)) - }) - engine.OnFullMatch("快手变装").SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { - ctx.SendChain(message.Video(ksbianzhuang)) - }) - engine.OnFullMatch("抖音变装").SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { - ctx.SendChain(message.Video(dybianzhuang)) - }) - engine.OnFullMatch("萌娃视频").SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { - ctx.SendChain(message.Video(mengwaURL)) - }) - engine.OnFullMatch("穿搭视频").SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { - ctx.SendChain(message.Video(chuandaURL)) - }) - engine.OnFullMatch("完美身材").SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { - ctx.SendChain(message.Video(wmscURL)) - }) - engine.OnFullMatch("御姐撒娇").SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { - ctx.SendChain(message.Record(yujieURL)) - }) - engine.OnFullMatch("绿茶语音").SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { - ctx.SendChain(message.Record(luchaURL)) - }) - engine.OnFullMatch("怼人语音").SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { - ctx.SendChain(message.Record(duirenURL)) - }) - engine.OnFullMatch("随机骚话").SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { - data, err := web.GetData(saohuaURL) - if err != nil { - ctx.SendChain(message.Text("ERROR: ", err)) - return + // 这里是您的处理逻辑的switch case重构版本 + engine.OnFullMatchGroup([]string{"小姐姐视频", "小姐姐视频2", "黑丝视频", "白丝视频", "欲梦视频", "甜妹视频", "双倍快乐", "纯情女高", "萝莉视频", "玉足视频", "帅哥视频", "热舞视频", "吊带视频", "汉服视频", "极品狱卒", "清纯视频", "快手变装", "抖音变装", "萌娃视频", "穿搭视频", "完美身材"}).SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { + videoType := ctx.State["matched"].(string) // 假设这是获取消息文本的方式 + var videoURL string + switch videoType { + case "小姐姐视频": + videoURL = zzxjjURL + case "小姐姐视频2": + videoURL = xjjURL + case "黑丝视频": + videoURL = heisisURL + case "白丝视频": + videoURL = baisisURL + case "欲梦视频": + videoURL = ndymURL + case "甜妹视频": + videoURL = tianmeiURL + case "双倍快乐": + videoURL = sbklURL + case "纯情女高": + videoURL = nvgaoURL + case "萝莉视频": + videoURL = luoliURL + case "玉足视频": + videoURL = yuzuURL + case "帅哥视频": + videoURL = xggURL + case "热舞视频": + videoURL = rewuURL + case "吊带视频": + videoURL = diaodaiURL + case "汉服视频": + videoURL = hanfuURL + case "极品狱卒": + videoURL = jpyzURL + case "清纯视频": + videoURL = qingchunURL + case "快手变装": + videoURL = ksbianzhuang + case "抖音变装": + videoURL = dybianzhuang + case "萌娃视频": + videoURL = mengwaURL + case "穿搭视频": + videoURL = chuandaURL + case "完美身材": + videoURL = wmscURL + default: + // 如果没有匹配的情况,可以选择发送默认响应或者不做任何处理 + } + + if videoURL != "" { + ctx.SendChain(message.Video(videoURL)) } - ctx.SendChain(message.Reply(ctx.Event.MessageID), message.Text(binary.BytesToString(data))) }) - engine.OnFullMatch("土味情话").SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { - data, err := web.GetData(qinghuaURL) - if err != nil { - ctx.SendChain(message.Text("ERROR: ", err)) - return + engine.OnFullMatchGroup([]string{"御姐撒娇", "绿茶语音", "怼人语音"}).SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { + recordType := ctx.State["matched"].(string) // 假设这是获取消息文本的方式 + var recordURL string + switch recordType { + case "御姐撒娇": + recordURL = yujieURL + case "绿茶语音": + recordURL = luchaURL + case "怼人语音": + recordURL = duirenURL + default: + // 如果没有匹配的情况,可以选择发送默认响应或者不做任何处理 + } + if recordURL != "" { + ctx.SendChain(message.Record(recordURL)) } - ctx.SendChain(message.Reply(ctx.Event.MessageID), message.Text(binary.BytesToString(data))) }) - engine.OnFullMatch("随机污句子").SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { - data, err := web.GetData(wuURL) + engine.OnFullMatchGroup([]string{"随机骚话", "土味情话", "随机污句子"}).SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { + textType := ctx.State["matched"].(string) // 假设这是获取消息文本的方式 + var textURL string + switch textType { + case "随机骚话": + textURL = saohuaURL + case "土味情话": + textURL = qinghuaURL + case "随机污句子": + textURL = wuURL + default: + // 如果没有匹配的情况,可以选择发送默认响应或者不做任何处理 + } + data, err := web.GetData(textURL) if err != nil { ctx.SendChain(message.Text("ERROR: ", err)) return From ff35f5c97f6c62f35b7ac140b80494bb960bdadd Mon Sep 17 00:00:00 2001 From: himawari <1156544355@qq.com> Date: Thu, 11 Apr 2024 12:42:38 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E2=9C=A8=20=E4=B8=80=E8=B5=B7=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/lolimi/lolimi.go | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/plugin/lolimi/lolimi.go b/plugin/lolimi/lolimi.go index 97ef42ba72..7506b93369 100644 --- a/plugin/lolimi/lolimi.go +++ b/plugin/lolimi/lolimi.go @@ -105,8 +105,14 @@ func init() { msg := ctx.State["regex_matched"].([]string)[2] recordURL := "" switch name { - case "塔菲": - data, err := web.GetData(fmt.Sprintf(tafeiURL, url.QueryEscape(msg))) + case "塔菲", "东雪莲": + ttsURL := "" + if name == "塔菲" { + ttsURL = tafeiURL + } else { + ttsURL = dxlURL + } + data, err := web.GetData(fmt.Sprintf(ttsURL, url.QueryEscape(msg))) if err != nil { ctx.SendChain(message.Text("ERROR: ", err)) return @@ -114,13 +120,6 @@ func init() { recordURL = gjson.Get(binary.BytesToString(data), "music").String() case "嘉然": recordURL = fmt.Sprintf(jiaranURL, url.QueryEscape(msg)) - case "东雪莲": - data, err := web.GetData(fmt.Sprintf(dxlURL, url.QueryEscape(msg))) - if err != nil { - ctx.SendChain(message.Text("ERROR: ", err)) - return - } - recordURL = gjson.Get(binary.BytesToString(data), "music").String() default: recordURL = fmt.Sprintf(jiaranURL, url.QueryEscape(msg)) } From 61a05f263ccf40ca301244a766dc8f3df713682e Mon Sep 17 00:00:00 2001 From: himawari <1156544355@qq.com> Date: Fri, 12 Apr 2024 13:39:26 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E2=9C=A8=20=E4=BF=AE=E6=94=B9=E6=88=90map?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/yujn/yujn.go | 102 ++++++++++++++------------------------------ 1 file changed, 32 insertions(+), 70 deletions(-) diff --git a/plugin/yujn/yujn.go b/plugin/yujn/yujn.go index 3f1ea91937..1f42df48f6 100644 --- a/plugin/yujn/yujn.go +++ b/plugin/yujn/yujn.go @@ -61,94 +61,56 @@ var ( "- 完美身材\n- 御姐撒娇\n- 绿茶语音\n- 怼人语音\n" + "- 随机骚话\n- 随机污句子\n- 随机美句\n- 土味情话\n- 让[丁真|陈泽|梅西|孙笑川|科比|懒羊羊|胡桃|雫るる]说我测尼玛", }) + urlMap = map[string]string{ + "小姐姐视频": zzxjjURL, + "小姐姐视频2": xjjURL, + "黑丝视频": heisisURL, + "白丝视频": baisisURL, + "欲梦视频": ndymURL, + "甜妹视频": tianmeiURL, + "双倍快乐": sbklURL, + "纯情女高": nvgaoURL, + "萝莉视频": luoliURL, + "玉足视频": yuzuURL, + "帅哥视频": xggURL, + "热舞视频": rewuURL, + "吊带视频": diaodaiURL, + "汉服视频": hanfuURL, + "极品狱卒": jpyzURL, + "清纯视频": qingchunURL, + "快手变装": ksbianzhuang, + "抖音变装": dybianzhuang, + "萌娃视频": mengwaURL, + "穿搭视频": chuandaURL, + "完美身材": wmscURL, + "御姐撒娇": yujieURL, + "绿茶语音": luchaURL, + "怼人语音": duirenURL, + "随机骚话": saohuaURL, + "土味情话": qinghuaURL, + "随机污句子": wuURL, + } ) func init() { // 这里是您的处理逻辑的switch case重构版本 engine.OnFullMatchGroup([]string{"小姐姐视频", "小姐姐视频2", "黑丝视频", "白丝视频", "欲梦视频", "甜妹视频", "双倍快乐", "纯情女高", "萝莉视频", "玉足视频", "帅哥视频", "热舞视频", "吊带视频", "汉服视频", "极品狱卒", "清纯视频", "快手变装", "抖音变装", "萌娃视频", "穿搭视频", "完美身材"}).SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { videoType := ctx.State["matched"].(string) // 假设这是获取消息文本的方式 - var videoURL string - switch videoType { - case "小姐姐视频": - videoURL = zzxjjURL - case "小姐姐视频2": - videoURL = xjjURL - case "黑丝视频": - videoURL = heisisURL - case "白丝视频": - videoURL = baisisURL - case "欲梦视频": - videoURL = ndymURL - case "甜妹视频": - videoURL = tianmeiURL - case "双倍快乐": - videoURL = sbklURL - case "纯情女高": - videoURL = nvgaoURL - case "萝莉视频": - videoURL = luoliURL - case "玉足视频": - videoURL = yuzuURL - case "帅哥视频": - videoURL = xggURL - case "热舞视频": - videoURL = rewuURL - case "吊带视频": - videoURL = diaodaiURL - case "汉服视频": - videoURL = hanfuURL - case "极品狱卒": - videoURL = jpyzURL - case "清纯视频": - videoURL = qingchunURL - case "快手变装": - videoURL = ksbianzhuang - case "抖音变装": - videoURL = dybianzhuang - case "萌娃视频": - videoURL = mengwaURL - case "穿搭视频": - videoURL = chuandaURL - case "完美身材": - videoURL = wmscURL - default: - // 如果没有匹配的情况,可以选择发送默认响应或者不做任何处理 - } - + videoURL := urlMap[videoType] if videoURL != "" { ctx.SendChain(message.Video(videoURL)) } }) engine.OnFullMatchGroup([]string{"御姐撒娇", "绿茶语音", "怼人语音"}).SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { recordType := ctx.State["matched"].(string) // 假设这是获取消息文本的方式 - var recordURL string - switch recordType { - case "御姐撒娇": - recordURL = yujieURL - case "绿茶语音": - recordURL = luchaURL - case "怼人语音": - recordURL = duirenURL - default: - // 如果没有匹配的情况,可以选择发送默认响应或者不做任何处理 - } + recordURL := urlMap[recordType] if recordURL != "" { ctx.SendChain(message.Record(recordURL)) } }) engine.OnFullMatchGroup([]string{"随机骚话", "土味情话", "随机污句子"}).SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { textType := ctx.State["matched"].(string) // 假设这是获取消息文本的方式 - var textURL string - switch textType { - case "随机骚话": - textURL = saohuaURL - case "土味情话": - textURL = qinghuaURL - case "随机污句子": - textURL = wuURL - default: - // 如果没有匹配的情况,可以选择发送默认响应或者不做任何处理 - } + textURL := urlMap[textType] data, err := web.GetData(textURL) if err != nil { ctx.SendChain(message.Text("ERROR: ", err)) From 00ef760af35a44fddd81ca5d34a7a181a1e4dd1a Mon Sep 17 00:00:00 2001 From: himawari <1156544355@qq.com> Date: Sat, 13 Apr 2024 16:00:49 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=F0=9F=8E=A8=20=E5=88=A0=E6=8E=89=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/yujn/yujn.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/plugin/yujn/yujn.go b/plugin/yujn/yujn.go index 1f42df48f6..ac9e2ac579 100644 --- a/plugin/yujn/yujn.go +++ b/plugin/yujn/yujn.go @@ -97,16 +97,13 @@ func init() { engine.OnFullMatchGroup([]string{"小姐姐视频", "小姐姐视频2", "黑丝视频", "白丝视频", "欲梦视频", "甜妹视频", "双倍快乐", "纯情女高", "萝莉视频", "玉足视频", "帅哥视频", "热舞视频", "吊带视频", "汉服视频", "极品狱卒", "清纯视频", "快手变装", "抖音变装", "萌娃视频", "穿搭视频", "完美身材"}).SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { videoType := ctx.State["matched"].(string) // 假设这是获取消息文本的方式 videoURL := urlMap[videoType] - if videoURL != "" { - ctx.SendChain(message.Video(videoURL)) - } + ctx.SendChain(message.Video(videoURL)) }) engine.OnFullMatchGroup([]string{"御姐撒娇", "绿茶语音", "怼人语音"}).SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { recordType := ctx.State["matched"].(string) // 假设这是获取消息文本的方式 recordURL := urlMap[recordType] - if recordURL != "" { - ctx.SendChain(message.Record(recordURL)) - } + ctx.SendChain(message.Record(recordURL)) + }) engine.OnFullMatchGroup([]string{"随机骚话", "土味情话", "随机污句子"}).SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) { textType := ctx.State["matched"].(string) // 假设这是获取消息文本的方式