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] 让[丁真|陈泽|梅西|孙笑川|科比|懒羊羊|胡桃|雫るる]说我测尼玛
", "") + 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) // 假设这是获取消息文本的方式