From 6dff747b5f75d4d6cba148393ea1c4f2d7df3543 Mon Sep 17 00:00:00 2001
From: lianhong <2758988938@qq.com>
Date: Fri, 4 Nov 2022 19:04:55 +0800
Subject: [PATCH 01/21] =?UTF-8?q?=E5=85=BD=E8=AF=AD=E5=8A=A0=E5=AF=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
README.md | 10 +++
main.go | 145 +++++++++++++++++----------------
plugin/lianhong/jiami/jiami.go | 122 +++++++++++++++++++++++++++
3 files changed, 205 insertions(+), 72 deletions(-)
create mode 100644 plugin/lianhong/jiami/jiami.go
diff --git a/README.md b/README.md
index 08042ebde0..6f7e0b8a60 100644
--- a/README.md
+++ b/README.md
@@ -485,6 +485,16 @@ print("run[CQ:image,file="+j["img"]+"]")
- [x] 天城文用yyy解密xxx
+
+
+ 兽语加密(嗷呜~)
+
+ `import _ "github.com/FloatTech/ZeroBot-Plugin/plugin/lianhong/jiami"`
+
+ - [x] 兽语加密xxx
+
+ - [x] 兽语解密xxx
+
bilibili
diff --git a/main.go b/main.go
index 0dae3b3966..48dffe8f20 100644
--- a/main.go
+++ b/main.go
@@ -58,78 +58,79 @@ import (
// vvvvvvvvvvvvvv //
// vvvv //
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/ahsai" // ahsai tts
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/ai_false" // 服务器监控
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/aipaint" // ai绘图
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/aiwife" // 随机老婆
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/alipayvoice" // 支付宝到账语音
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/b14" // base16384加解密
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/baidu" // 百度一下
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/baiduaudit" // 百度内容审核
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/base64gua" // base64卦加解密
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/baseamasiro" // base天城文加解密
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/bilibili" // b站相关
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/book_review" // 哀伤雪刃吧推书记录
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/cangtoushi" // 藏头诗
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/choose" // 选择困难症帮手
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/chouxianghua" // 说抽象话
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/chrev" // 英文字符翻转
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/coser" // 三次元小姐姐
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/cpstory" // cp短打
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/danbooru" // DeepDanbooru二次元图标签识别
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/diana" // 嘉心糖发病
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/drift_bottle" // 漂流瓶
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/emojimix" // 合成emoji
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/epidemic" // 城市疫情查询
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/event" // 好友申请群聊邀请事件处理
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/font" // 渲染任意文字到图片
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/fortune" // 运势
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/funny" // 笑话
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/genshin" // 原神抽卡
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/gif" // 制图
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/github" // 搜索GitHub仓库
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/guessmusic" // 猜歌
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/heisi" // 黑丝
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/hs" // 炉石
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/hyaku" // 百人一首
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/image_finder" // 关键字搜图
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/inject" // 注入指令
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/jandan" // 煎蛋网无聊图
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/jikipedia" // 小鸡词典
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/jptingroom" // 日语听力学习材料
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/juejuezi" // 绝绝子生成器
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/lolicon" // lolicon 随机图片
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/midicreate" // 简易midi音乐制作
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/moegoe" // 日韩 VITS 模型拟声
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/moyu" // 摸鱼
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/moyu_calendar" // 摸鱼人日历
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/music" // 点歌
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/nativesetu" // 本地涩图
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/nativewife" // 本地老婆
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/nbnhhsh" // 拼音首字母缩写释义工具
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/nihongo" // 日语语法学习
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/novel" // 铅笔小说网搜索
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/nsfw" // nsfw图片识别
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/omikuji" // 浅草寺求签
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/qqwife" // 一群一天一夫一妻制群老婆
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/reborn" // 投胎
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/runcode" // 在线运行代码
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/saucenao" // 以图搜图
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/scale" // 叔叔的AI二次元图片放大
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/score" // 分数
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/setutime" // 来份涩图
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/shadiao" // 沙雕app
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/shindan" // 测定
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/tarot" // 抽塔罗牌
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/tiangou" // 舔狗日记
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/tracemoe" // 搜番
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/translation" // 翻译
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/vtb_quotation" // vtb语录
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/wangyiyun" // 网易云音乐热评
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/wenxinAI" // 百度文心AI画图
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/word_count" // 聊天热词
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/wordle" // 猜单词
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/ymgal" // 月幕galgame
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/ahsai" // ahsai tts
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/ai_false" // 服务器监控
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/aipaint" // ai绘图
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/aiwife" // 随机老婆
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/alipayvoice" // 支付宝到账语音
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/b14" // base16384加解密
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/baidu" // 百度一下
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/baiduaudit" // 百度内容审核
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/base64gua" // base64卦加解密
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/baseamasiro" // base天城文加解密
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/bilibili" // b站相关
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/book_review" // 哀伤雪刃吧推书记录
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/cangtoushi" // 藏头诗
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/choose" // 选择困难症帮手
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/chouxianghua" // 说抽象话
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/chrev" // 英文字符翻转
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/coser" // 三次元小姐姐
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/cpstory" // cp短打
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/danbooru" // DeepDanbooru二次元图标签识别
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/diana" // 嘉心糖发病
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/drift_bottle" // 漂流瓶
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/emojimix" // 合成emoji
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/epidemic" // 城市疫情查询
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/event" // 好友申请群聊邀请事件处理
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/font" // 渲染任意文字到图片
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/fortune" // 运势
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/funny" // 笑话
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/genshin" // 原神抽卡
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/gif" // 制图
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/github" // 搜索GitHub仓库
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/guessmusic" // 猜歌
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/heisi" // 黑丝
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/hs" // 炉石
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/hyaku" // 百人一首
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/image_finder" // 关键字搜图
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/inject" // 注入指令
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/jandan" // 煎蛋网无聊图
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/jikipedia" // 小鸡词典
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/jptingroom" // 日语听力学习材料
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/juejuezi" // 绝绝子生成器
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/lianhong/jiami" // 兽语加密
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/lolicon" // lolicon 随机图片
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/midicreate" // 简易midi音乐制作
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/moegoe" // 日韩 VITS 模型拟声
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/moyu" // 摸鱼
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/moyu_calendar" // 摸鱼人日历
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/music" // 点歌
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/nativesetu" // 本地涩图
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/nativewife" // 本地老婆
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/nbnhhsh" // 拼音首字母缩写释义工具
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/nihongo" // 日语语法学习
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/novel" // 铅笔小说网搜索
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/nsfw" // nsfw图片识别
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/omikuji" // 浅草寺求签
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/qqwife" // 一群一天一夫一妻制群老婆
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/reborn" // 投胎
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/runcode" // 在线运行代码
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/saucenao" // 以图搜图
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/scale" // 叔叔的AI二次元图片放大
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/score" // 分数
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/setutime" // 来份涩图
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/shadiao" // 沙雕app
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/shindan" // 测定
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/tarot" // 抽塔罗牌
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/tiangou" // 舔狗日记
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/tracemoe" // 搜番
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/translation" // 翻译
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/vtb_quotation" // vtb语录
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/wangyiyun" // 网易云音乐热评
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/wenxinAI" // 百度文心AI画图
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/word_count" // 聊天热词
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/wordle" // 猜单词
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/ymgal" // 月幕galgame
// _ "github.com/FloatTech/ZeroBot-Plugin/plugin/wtf" // 鬼东西
diff --git a/plugin/lianhong/jiami/jiami.go b/plugin/lianhong/jiami/jiami.go
new file mode 100644
index 0000000000..9b28642784
--- /dev/null
+++ b/plugin/lianhong/jiami/jiami.go
@@ -0,0 +1,122 @@
+// Package jiami 兽语加密与解密
+package jiami
+
+import (
+ "encoding/json"
+ "fmt"
+
+ "github.com/FloatTech/floatbox/web"
+ ctrl "github.com/FloatTech/zbpctrl"
+ "github.com/FloatTech/zbputils/control"
+ zero "github.com/wdvxdr1123/ZeroBot"
+ "github.com/wdvxdr1123/ZeroBot/message"
+)
+
+const (
+ jiami1 = "http://ovooa.com/API/sho_u/?msg=%v" // 加密api地址
+ jiami2 = "http://ovooa.com/API/sho_u/?format=1&msg=%v" // 解密api地址
+
+)
+
+type nmd struct { // struct解析格式大概是
+ Code int `json:"code"`
+ Text string `json:"text"`
+ Data struct {
+ Message string `json:"Message"`
+ } `json:"data"`
+}
+
+func init() { // 主函数
+ en := control.Register("jiami", &ctrl.Options[*zero.Ctx]{
+ DisableOnDefault: false,
+ Help: "兽语加解密\n" +
+ "- 兽语加密xxx\n- 兽语解密xxx",
+ })
+ en.OnRegex(`^兽语加密\s*(.+)$`).SetBlock(true). // 正值输入
+ Handle(func(ctx *zero.Ctx) {
+ str := ctx.State["regex_matched"].([]string)[1]
+ // es := base14.EncodeString(str)
+ es, err := web.GetData(fmt.Sprintf(jiami1, str)) // 将网站返回结果赋值
+ if err != nil {
+ ctx.SendChain(message.Text("出现错误捏:", err))
+ }
+
+ // es1 := fmt.Sprintf("%s", es)
+ var r nmd // r数组
+ err = json.Unmarshal(es, &r) // 填api返回结果,struct地址
+ if err != nil {
+ ctx.SendChain(message.Text("出现错误捏:", err))
+ }
+
+ /*if es != "" {
+ ctx.SendChain(message.Text(es))
+ } else {
+ ctx.SendChain(message.Text("加密失败!"))
+ }*/
+
+ ctx.SendChain(message.Text(r.Data.Message)) // 输出提取后的结果
+ })
+
+ en.OnRegex(`^兽语解密\s*(.+)$`).SetBlock(true). // 正值输入
+ Handle(func(ctx *zero.Ctx) {
+ str := ctx.State["regex_matched"].([]string)[1]
+ // es := base14.EncodeString(str)
+ es, err := web.GetData(fmt.Sprintf(jiami2, str)) // 将网站返回结果赋值
+ if err != nil {
+ ctx.SendChain(message.Text("出现错误捏:", err))
+ }
+ var n nmd // r数组
+ err = json.Unmarshal(es, &n) // 填api返回结果,struct地址
+ if err != nil {
+ ctx.SendChain(message.Text("出现错误捏:", err))
+ }
+ ctx.SendChain(message.Text(n.Data.Message)) // 输出提取后的结果
+ })
+}
+
+/*en.OnRegex(`^解密\s*([一-踀]+[㴁-㴆]?)$`).SetBlock(true).
+ Handle(func(ctx *zero.Ctx) {
+ str := ctx.State["regex_matched"].([]string)[1]
+ es := base14.DecodeString(str)
+
+ if es != "" {
+ ctx.SendChain(message.Text(es))
+ } else {
+ ctx.SendChain(message.Text("解密失败!"))
+ }
+ })
+}*/
+
+/* Package jiami 兽语加密专版
+package jiami
+
+import (
+ "fmt"
+
+ "github.com/FloatTech/floatbox/web"
+ ctrl "github.com/FloatTech/zbpctrl"
+ "github.com/FloatTech/zbputils/control"
+ zero "github.com/wdvxdr1123/ZeroBot"
+ "github.com/wdvxdr1123/ZeroBot/message"
+)
+
+const (
+ tiangouURL = "http://ovooa.com/API/sho_u/?msg=%v"
+)
+
+func init() {
+ engine := control.Register("jiami", &ctrl.Options[*zero.Ctx]{
+ DisableOnDefault: false,
+ Help: "舔狗日记\n- 舔狗123456",
+ })
+ engine.OnRegex(`^兽语加密\s?(\d+)$`).SetBlock(true).Handle(func(ctx *zero.Ctx) {
+ regexMatched := ctx.State["regex_matched"].([]string)
+ // ctx.SendChain(message.Text(regexMatched[1]))
+ data, err := web.GetData(fmt.Sprintf(tiangouURL, regexMatched[1]))
+ if err != nil {
+ ctx.SendChain(message.Text("Error:", err))
+ }
+ ctx.SendChain(message.Text(data))
+ })
+}
+*/
From 68e878913a63f89372f7c6e3590ea366c2f90e48 Mon Sep 17 00:00:00 2001
From: lianhong <2758988938@qq.com>
Date: Fri, 4 Nov 2022 20:00:21 +0800
Subject: [PATCH 02/21] =?UTF-8?q?=E7=BB=9F=E4=B8=80=E6=A0=BC=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
main.go | 2 +-
plugin/{lianhong => }/jiami/jiami.go | 48 +---------------------------
2 files changed, 2 insertions(+), 48 deletions(-)
rename plugin/{lianhong => }/jiami/jiami.go (65%)
diff --git a/main.go b/main.go
index 48dffe8f20..3f392612a1 100644
--- a/main.go
+++ b/main.go
@@ -98,7 +98,7 @@ import (
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/jikipedia" // 小鸡词典
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/jptingroom" // 日语听力学习材料
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/juejuezi" // 绝绝子生成器
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/lianhong/jiami" // 兽语加密
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/jiami" // 兽语加密
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/lolicon" // lolicon 随机图片
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/midicreate" // 简易midi音乐制作
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/moegoe" // 日韩 VITS 模型拟声
diff --git a/plugin/lianhong/jiami/jiami.go b/plugin/jiami/jiami.go
similarity index 65%
rename from plugin/lianhong/jiami/jiami.go
rename to plugin/jiami/jiami.go
index 9b28642784..56ff366da6 100644
--- a/plugin/lianhong/jiami/jiami.go
+++ b/plugin/jiami/jiami.go
@@ -69,54 +69,8 @@ func init() { // 主函数
err = json.Unmarshal(es, &n) // 填api返回结果,struct地址
if err != nil {
ctx.SendChain(message.Text("出现错误捏:", err))
+ return
}
ctx.SendChain(message.Text(n.Data.Message)) // 输出提取后的结果
})
}
-
-/*en.OnRegex(`^解密\s*([一-踀]+[㴁-㴆]?)$`).SetBlock(true).
- Handle(func(ctx *zero.Ctx) {
- str := ctx.State["regex_matched"].([]string)[1]
- es := base14.DecodeString(str)
-
- if es != "" {
- ctx.SendChain(message.Text(es))
- } else {
- ctx.SendChain(message.Text("解密失败!"))
- }
- })
-}*/
-
-/* Package jiami 兽语加密专版
-package jiami
-
-import (
- "fmt"
-
- "github.com/FloatTech/floatbox/web"
- ctrl "github.com/FloatTech/zbpctrl"
- "github.com/FloatTech/zbputils/control"
- zero "github.com/wdvxdr1123/ZeroBot"
- "github.com/wdvxdr1123/ZeroBot/message"
-)
-
-const (
- tiangouURL = "http://ovooa.com/API/sho_u/?msg=%v"
-)
-
-func init() {
- engine := control.Register("jiami", &ctrl.Options[*zero.Ctx]{
- DisableOnDefault: false,
- Help: "舔狗日记\n- 舔狗123456",
- })
- engine.OnRegex(`^兽语加密\s?(\d+)$`).SetBlock(true).Handle(func(ctx *zero.Ctx) {
- regexMatched := ctx.State["regex_matched"].([]string)
- // ctx.SendChain(message.Text(regexMatched[1]))
- data, err := web.GetData(fmt.Sprintf(tiangouURL, regexMatched[1]))
- if err != nil {
- ctx.SendChain(message.Text("Error:", err))
- }
- ctx.SendChain(message.Text(data))
- })
-}
-*/
From 050146f9c1c28a343415f504a51df6b1a4d9418e Mon Sep 17 00:00:00 2001
From: lianhong <2758988938@qq.com>
Date: Fri, 4 Nov 2022 20:00:50 +0800
Subject: [PATCH 03/21] =?UTF-8?q?=E7=BB=9F=E4=B8=80=E6=A0=BC=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 6f7e0b8a60..e071179b45 100644
--- a/README.md
+++ b/README.md
@@ -489,7 +489,7 @@ print("run[CQ:image,file="+j["img"]+"]")
兽语加密(嗷呜~)
- `import _ "github.com/FloatTech/ZeroBot-Plugin/plugin/lianhong/jiami"`
+ `import _ "github.com/FloatTech/ZeroBot-Plugin/plugin/jiami"`
- [x] 兽语加密xxx
From f7b4bb61af52457e494202e85e2086d9e2645e91 Mon Sep 17 00:00:00 2001
From: lianhong <2758988938@qq.com>
Date: Fri, 4 Nov 2022 20:22:41 +0800
Subject: [PATCH 04/21] =?UTF-8?q?=E5=A4=A9=E6=B0=94/=E6=8B=BC=E9=9F=B3?=
=?UTF-8?q?=E6=9F=A5=E8=AF=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
README.md | 14 ++++
main.go | 147 ++++++++++++++++++++--------------------
plugin/wenben/wenben.go | 115 +++++++++++++++++++++++++++++++
3 files changed, 203 insertions(+), 73 deletions(-)
create mode 100644 plugin/wenben/wenben.go
diff --git a/README.md b/README.md
index e071179b45..3f6d17f875 100644
--- a/README.md
+++ b/README.md
@@ -1270,6 +1270,20 @@ print("run[CQ:image,file="+j["img"]+"]")
- [x] 舔狗日记
+
+
+ 天气/拼音查询-名言
+
+ `import _ "github.com/FloatTech/ZeroBot-Plugin/plugin/wenben"`
+
+ - [x] xx天气
+
+ - [x] xx拼音
+
+ - [x] 每日情话/一言/鸡汤
+
+ - [x] 绕口令
+
聊天热词
diff --git a/main.go b/main.go
index 3f392612a1..8264a668d9 100644
--- a/main.go
+++ b/main.go
@@ -58,79 +58,80 @@ import (
// vvvvvvvvvvvvvv //
// vvvv //
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/ahsai" // ahsai tts
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/ai_false" // 服务器监控
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/aipaint" // ai绘图
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/aiwife" // 随机老婆
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/alipayvoice" // 支付宝到账语音
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/b14" // base16384加解密
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/baidu" // 百度一下
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/baiduaudit" // 百度内容审核
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/base64gua" // base64卦加解密
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/baseamasiro" // base天城文加解密
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/bilibili" // b站相关
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/book_review" // 哀伤雪刃吧推书记录
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/cangtoushi" // 藏头诗
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/choose" // 选择困难症帮手
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/chouxianghua" // 说抽象话
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/chrev" // 英文字符翻转
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/coser" // 三次元小姐姐
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/cpstory" // cp短打
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/danbooru" // DeepDanbooru二次元图标签识别
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/diana" // 嘉心糖发病
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/drift_bottle" // 漂流瓶
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/emojimix" // 合成emoji
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/epidemic" // 城市疫情查询
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/event" // 好友申请群聊邀请事件处理
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/font" // 渲染任意文字到图片
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/fortune" // 运势
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/funny" // 笑话
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/genshin" // 原神抽卡
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/gif" // 制图
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/github" // 搜索GitHub仓库
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/guessmusic" // 猜歌
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/heisi" // 黑丝
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/hs" // 炉石
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/hyaku" // 百人一首
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/image_finder" // 关键字搜图
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/inject" // 注入指令
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/jandan" // 煎蛋网无聊图
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/jikipedia" // 小鸡词典
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/jptingroom" // 日语听力学习材料
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/juejuezi" // 绝绝子生成器
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/jiami" // 兽语加密
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/lolicon" // lolicon 随机图片
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/midicreate" // 简易midi音乐制作
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/moegoe" // 日韩 VITS 模型拟声
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/moyu" // 摸鱼
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/moyu_calendar" // 摸鱼人日历
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/music" // 点歌
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/nativesetu" // 本地涩图
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/nativewife" // 本地老婆
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/nbnhhsh" // 拼音首字母缩写释义工具
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/nihongo" // 日语语法学习
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/novel" // 铅笔小说网搜索
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/nsfw" // nsfw图片识别
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/omikuji" // 浅草寺求签
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/qqwife" // 一群一天一夫一妻制群老婆
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/reborn" // 投胎
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/runcode" // 在线运行代码
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/saucenao" // 以图搜图
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/scale" // 叔叔的AI二次元图片放大
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/score" // 分数
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/setutime" // 来份涩图
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/shadiao" // 沙雕app
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/shindan" // 测定
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/tarot" // 抽塔罗牌
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/tiangou" // 舔狗日记
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/tracemoe" // 搜番
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/translation" // 翻译
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/vtb_quotation" // vtb语录
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/wangyiyun" // 网易云音乐热评
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/wenxinAI" // 百度文心AI画图
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/word_count" // 聊天热词
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/wordle" // 猜单词
- _ "github.com/FloatTech/ZeroBot-Plugin/plugin/ymgal" // 月幕galgame
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/ahsai" // ahsai tts
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/ai_false" // 服务器监控
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/aipaint" // ai绘图
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/aiwife" // 随机老婆
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/alipayvoice" // 支付宝到账语音
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/b14" // base16384加解密
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/baidu" // 百度一下
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/baiduaudit" // 百度内容审核
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/base64gua" // base64卦加解密
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/baseamasiro" // base天城文加解密
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/bilibili" // b站相关
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/book_review" // 哀伤雪刃吧推书记录
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/cangtoushi" // 藏头诗
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/choose" // 选择困难症帮手
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/chouxianghua" // 说抽象话
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/chrev" // 英文字符翻转
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/coser" // 三次元小姐姐
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/cpstory" // cp短打
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/danbooru" // DeepDanbooru二次元图标签识别
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/diana" // 嘉心糖发病
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/drift_bottle" // 漂流瓶
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/emojimix" // 合成emoji
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/epidemic" // 城市疫情查询
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/event" // 好友申请群聊邀请事件处理
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/font" // 渲染任意文字到图片
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/fortune" // 运势
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/funny" // 笑话
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/genshin" // 原神抽卡
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/gif" // 制图
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/github" // 搜索GitHub仓库
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/guessmusic" // 猜歌
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/heisi" // 黑丝
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/hs" // 炉石
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/hyaku" // 百人一首
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/image_finder" // 关键字搜图
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/inject" // 注入指令
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/jandan" // 煎蛋网无聊图
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/jiami" // 兽语加密
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/jikipedia" // 小鸡词典
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/jptingroom" // 日语听力学习材料
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/juejuezi" // 绝绝子生成器
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/lolicon" // lolicon 随机图片
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/midicreate" // 简易midi音乐制作
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/moegoe" // 日韩 VITS 模型拟声
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/moyu" // 摸鱼
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/moyu_calendar" // 摸鱼人日历
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/music" // 点歌
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/nativesetu" // 本地涩图
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/nativewife" // 本地老婆
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/nbnhhsh" // 拼音首字母缩写释义工具
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/nihongo" // 日语语法学习
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/novel" // 铅笔小说网搜索
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/nsfw" // nsfw图片识别
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/omikuji" // 浅草寺求签
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/qqwife" // 一群一天一夫一妻制群老婆
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/reborn" // 投胎
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/runcode" // 在线运行代码
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/saucenao" // 以图搜图
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/scale" // 叔叔的AI二次元图片放大
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/score" // 分数
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/setutime" // 来份涩图
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/shadiao" // 沙雕app
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/shindan" // 测定
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/tarot" // 抽塔罗牌
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/tiangou" // 舔狗日记
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/tracemoe" // 搜番
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/translation" // 翻译
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/vtb_quotation" // vtb语录
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/wangyiyun" // 网易云音乐热评
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/wenben" // 文本指令大全
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/wenxinAI" // 百度文心AI画图
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/word_count" // 聊天热词
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/wordle" // 猜单词
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/ymgal" // 月幕galgame
// _ "github.com/FloatTech/ZeroBot-Plugin/plugin/wtf" // 鬼东西
diff --git a/plugin/wenben/wenben.go b/plugin/wenben/wenben.go
new file mode 100644
index 0000000000..9ef89e05e8
--- /dev/null
+++ b/plugin/wenben/wenben.go
@@ -0,0 +1,115 @@
+// Package wenben 文本链接
+package wenben
+
+import (
+ "encoding/json"
+ "fmt"
+
+ "github.com/FloatTech/floatbox/web"
+ ctrl "github.com/FloatTech/zbpctrl"
+ "github.com/FloatTech/zbputils/control"
+ zero "github.com/wdvxdr1123/ZeroBot"
+ "github.com/wdvxdr1123/ZeroBot/message"
+)
+
+const (
+ tianqi = "https://xiaobai.klizi.cn/API/other/weather_1.php?data=&msg=%v" // api地址
+ pinyin = "http://ovooa.com/API/pinyin/api.php?type=text&msg=%v"
+ url = "https://v1.hitokoto.cn/?c=a&c=b&c=c&c=d&c=h&c=i" // 动漫 漫画 游戏 文学 影视 诗词
+)
+
+type RspData struct {
+ Id int `json:"id"`
+ Uuid string `json:"uuid"`
+ Hitokoto string `json:"hitokoto"`
+ Type string `json:"type"`
+ From string `json:"from"`
+ FromWho string `json:"from_who"`
+ Creator string `json:"creator"`
+ CreatorUid int `json:"creator_uid"`
+ Reviewer int `json:"reviewer"`
+ CommitFrom string `json:"commit_from"`
+ CreatedAt string `json:"created_at"`
+ Length int `json:"length"`
+}
+
+func init() { // 主函数
+ en := control.Register("tianqi", &ctrl.Options[*zero.Ctx]{
+ DisableOnDefault: false,
+ Help: "文本命令大全\n" +
+ "- 天气查询:xxx天气" +
+ "- 拼音查询:xxx拼音" +
+ "- 每日一言" +
+ "- 每日鸡汤" +
+ "- 每日情话" +
+ "- 绕口令",
+ })
+ en.OnFullMatch("每日一言").SetBlock(true).Handle(handle) //每日一言
+ en.OnSuffix("天气").SetBlock(true).
+ Handle(func(ctx *zero.Ctx) {
+ str := ctx.State["args"].(string)
+ es, err := web.GetData(fmt.Sprintf(tianqi, str)) // 将网站返回结果赋值
+ if err != nil {
+ ctx.SendChain(message.Text("出现错误捏:", err))
+ return
+ }
+ km := string(es)
+ ctx.SendChain(message.Text(str+"天气如下:\n", km))
+ })
+ en.OnSuffix("拼音").SetBlock(true).
+ Handle(func(ctx *zero.Ctx) {
+ str := ctx.State["args"].(string)
+ es, err := web.GetData(fmt.Sprintf(pinyin, str)) // 将网站返回结果赋值
+ if err != nil {
+ ctx.SendChain(message.Text("出现错误捏:", err))
+ return
+ }
+ km := string(es)
+ ctx.SendChain(message.Text(str+"的拼音为:", km))
+ })
+ en.OnFullMatch("每日情话").SetBlock(true).
+ Handle(func(ctx *zero.Ctx) {
+ data, err := web.GetData("https://xiaobai.klizi.cn/API/other/wtqh.php")
+ if err != nil {
+ ctx.SendChain(message.Text("获取失败惹", err))
+ return
+ }
+ km := fmt.Sprintf("%s", data)
+ ctx.SendChain(message.Text(km))
+ })
+ en.OnFullMatch("每日鸡汤").SetBlock(true).
+ Handle(func(ctx *zero.Ctx) {
+ data, err := web.GetData("http://api.btstu.cn/yan/api.php?charset=utf-8&encode=text")
+ if err != nil {
+ ctx.SendChain(message.Text("获取失败惹", err))
+ return
+ }
+ km := string(data)
+ ctx.SendChain(message.Text(km))
+ })
+ en.OnFullMatch("绕口令").SetBlock(true).
+ Handle(func(ctx *zero.Ctx) {
+ data, err := web.GetData("http://ovooa.com/API/rao/api.php?type=text")
+ if err != nil {
+ ctx.SendChain(message.Text("获取失败惹", err))
+ return
+ }
+ km := string(data)
+ ctx.SendChain(message.Text(km))
+ })
+}
+func handle(ctx *zero.Ctx) {
+ var rsp RspData
+ data, err := web.GetData(url)
+ if err != nil {
+ ctx.SendChain(message.Text("Err:", err))
+ return
+ }
+ json.Unmarshal(data, &rsp)
+ msg := ""
+ msg += rsp.Hitokoto + "\n出自:" + rsp.From + "\n"
+ if len(rsp.FromWho) != 0 {
+ msg += "作者:" + rsp.FromWho
+ }
+ ctx.SendChain(message.Text(msg))
+}
From 7129997cbdfca5580f1776dbf21f49f5ac9ff699 Mon Sep 17 00:00:00 2001
From: lianhong2758 <2758988938@qq.com>
Date: Fri, 4 Nov 2022 20:57:11 +0800
Subject: [PATCH 05/21] =?UTF-8?q?Update=20and=20rename=20plugin/jiami/jiam?=
=?UTF-8?q?i.go=20to=20.plugin/=E4=BD=B3=E7=BE=8E/jiami.go?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../\344\275\263\347\276\216/jiami.go" | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
rename plugin/jiami/jiami.go => ".plugin/\344\275\263\347\276\216/jiami.go" (94%)
diff --git a/plugin/jiami/jiami.go "b/.plugin/\344\275\263\347\276\216/jiami.go"
similarity index 94%
rename from plugin/jiami/jiami.go
rename to ".plugin/\344\275\263\347\276\216/jiami.go"
index 56ff366da6..9d5d32fb6c 100644
--- a/plugin/jiami/jiami.go
+++ "b/.plugin/\344\275\263\347\276\216/jiami.go"
@@ -39,6 +39,7 @@ func init() { // 主函数
es, err := web.GetData(fmt.Sprintf(jiami1, str)) // 将网站返回结果赋值
if err != nil {
ctx.SendChain(message.Text("出现错误捏:", err))
+ return
}
// es1 := fmt.Sprintf("%s", es)
@@ -46,14 +47,8 @@ func init() { // 主函数
err = json.Unmarshal(es, &r) // 填api返回结果,struct地址
if err != nil {
ctx.SendChain(message.Text("出现错误捏:", err))
+ return
}
-
- /*if es != "" {
- ctx.SendChain(message.Text(es))
- } else {
- ctx.SendChain(message.Text("加密失败!"))
- }*/
-
ctx.SendChain(message.Text(r.Data.Message)) // 输出提取后的结果
})
@@ -64,6 +59,7 @@ func init() { // 主函数
es, err := web.GetData(fmt.Sprintf(jiami2, str)) // 将网站返回结果赋值
if err != nil {
ctx.SendChain(message.Text("出现错误捏:", err))
+ return
}
var n nmd // r数组
err = json.Unmarshal(es, &n) // 填api返回结果,struct地址
From 02d92118dc2e1495fc4ed04010286a95f0c5f770 Mon Sep 17 00:00:00 2001
From: lianhong <2758988938@qq.com>
Date: Fri, 4 Nov 2022 21:58:13 +0800
Subject: [PATCH 06/21] =?UTF-8?q?=E8=A7=84=E8=8C=83=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
plugin/jiami/jiami.go | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/plugin/jiami/jiami.go b/plugin/jiami/jiami.go
index 56ff366da6..bb07ac2d07 100644
--- a/plugin/jiami/jiami.go
+++ b/plugin/jiami/jiami.go
@@ -39,6 +39,7 @@ func init() { // 主函数
es, err := web.GetData(fmt.Sprintf(jiami1, str)) // 将网站返回结果赋值
if err != nil {
ctx.SendChain(message.Text("出现错误捏:", err))
+ return
}
// es1 := fmt.Sprintf("%s", es)
@@ -46,14 +47,8 @@ func init() { // 主函数
err = json.Unmarshal(es, &r) // 填api返回结果,struct地址
if err != nil {
ctx.SendChain(message.Text("出现错误捏:", err))
+ return
}
-
- /*if es != "" {
- ctx.SendChain(message.Text(es))
- } else {
- ctx.SendChain(message.Text("加密失败!"))
- }*/
-
ctx.SendChain(message.Text(r.Data.Message)) // 输出提取后的结果
})
@@ -64,6 +59,7 @@ func init() { // 主函数
es, err := web.GetData(fmt.Sprintf(jiami2, str)) // 将网站返回结果赋值
if err != nil {
ctx.SendChain(message.Text("出现错误捏:", err))
+ return
}
var n nmd // r数组
err = json.Unmarshal(es, &n) // 填api返回结果,struct地址
From 00f88ae624937bbb92305973ef38e3ee0eaab170 Mon Sep 17 00:00:00 2001
From: lianhong <2758988938@qq.com>
Date: Fri, 4 Nov 2022 22:01:37 +0800
Subject: [PATCH 07/21] 1
---
".plugin/\344\275\263\347\276\216/jiami.go" | 73 ---------------------
1 file changed, 73 deletions(-)
delete mode 100644 ".plugin/\344\275\263\347\276\216/jiami.go"
diff --git "a/.plugin/\344\275\263\347\276\216/jiami.go" "b/.plugin/\344\275\263\347\276\216/jiami.go"
deleted file mode 100644
index 9f6909cafd..0000000000
--- "a/.plugin/\344\275\263\347\276\216/jiami.go"
+++ /dev/null
@@ -1,73 +0,0 @@
-// Package jiami 兽语加密与解密
-package jiami
-
-import (
- "encoding/json"
- "fmt"
-
- "github.com/FloatTech/floatbox/web"
- ctrl "github.com/FloatTech/zbpctrl"
- "github.com/FloatTech/zbputils/control"
- zero "github.com/wdvxdr1123/ZeroBot"
- "github.com/wdvxdr1123/ZeroBot/message"
-)
-
-const (
- jiami1 = "http://ovooa.com/API/sho_u/?msg=%v" // 加密api地址
- jiami2 = "http://ovooa.com/API/sho_u/?format=1&msg=%v" // 解密api地址
-
-)
-
-type nmd struct { // struct解析格式大概是
- Code int `json:"code"`
- Text string `json:"text"`
- Data struct {
- Message string `json:"Message"`
- } `json:"data"`
-}
-
-func init() { // 主函数
- en := control.Register("jiami", &ctrl.Options[*zero.Ctx]{
- DisableOnDefault: false,
- Help: "兽语加解密\n" +
- "- 兽语加密xxx\n- 兽语解密xxx",
- })
- en.OnRegex(`^兽语加密\s*(.+)$`).SetBlock(true). // 正值输入
- Handle(func(ctx *zero.Ctx) {
- str := ctx.State["regex_matched"].([]string)[1]
- // es := base14.EncodeString(str)
- es, err := web.GetData(fmt.Sprintf(jiami1, str)) // 将网站返回结果赋值
- if err != nil {
- ctx.SendChain(message.Text("出现错误捏:", err))
- return
- }
-
- // es1 := fmt.Sprintf("%s", es)
- var r nmd // r数组
- err = json.Unmarshal(es, &r) // 填api返回结果,struct地址
- if err != nil {
- ctx.SendChain(message.Text("出现错误捏:", err))
- return
- return
- }
- ctx.SendChain(message.Text(r.Data.Message)) // 输出提取后的结果
- })
-
- en.OnRegex(`^兽语解密\s*(.+)$`).SetBlock(true). // 正值输入
- Handle(func(ctx *zero.Ctx) {
- str := ctx.State["regex_matched"].([]string)[1]
- // es := base14.EncodeString(str)
- es, err := web.GetData(fmt.Sprintf(jiami2, str)) // 将网站返回结果赋值
- if err != nil {
- ctx.SendChain(message.Text("出现错误捏:", err))
- return
- }
- var n nmd // r数组
- err = json.Unmarshal(es, &n) // 填api返回结果,struct地址
- if err != nil {
- ctx.SendChain(message.Text("出现错误捏:", err))
- return
- }
- ctx.SendChain(message.Text(n.Data.Message)) // 输出提取后的结果
- })
-}
From 8a050b7a45a72085344704e101fbb4d158b0f9e7 Mon Sep 17 00:00:00 2001
From: lianhong <2758988938@qq.com>
Date: Sat, 5 Nov 2022 00:42:43 +0800
Subject: [PATCH 08/21] 1
---
plugin/wenben/wenben.go | 25 +++++++++++++------------
1 file changed, 13 insertions(+), 12 deletions(-)
diff --git a/plugin/wenben/wenben.go b/plugin/wenben/wenben.go
index 9ef89e05e8..fde0a102b3 100644
--- a/plugin/wenben/wenben.go
+++ b/plugin/wenben/wenben.go
@@ -10,6 +10,7 @@ import (
"github.com/FloatTech/zbputils/control"
zero "github.com/wdvxdr1123/ZeroBot"
"github.com/wdvxdr1123/ZeroBot/message"
+ "github.com/wdvxdr1123/ZeroBot/utils/helper"
)
const (
@@ -19,14 +20,14 @@ const (
)
type RspData struct {
- Id int `json:"id"`
- Uuid string `json:"uuid"`
+ Id int `json:"ID"`
+ Uuid string `json:"UUID"`
Hitokoto string `json:"hitokoto"`
Type string `json:"type"`
From string `json:"from"`
FromWho string `json:"from_who"`
Creator string `json:"creator"`
- CreatorUid int `json:"creator_uid"`
+ CreatorUid int `json:"creator_UID"`
Reviewer int `json:"reviewer"`
CommitFrom string `json:"commit_from"`
CreatedAt string `json:"created_at"`
@@ -53,8 +54,7 @@ func init() { // 主函数
ctx.SendChain(message.Text("出现错误捏:", err))
return
}
- km := string(es)
- ctx.SendChain(message.Text(str+"天气如下:\n", km))
+ ctx.SendChain(message.Text(str+"天气如下:\n", helper.BytesToString(es)))
})
en.OnSuffix("拼音").SetBlock(true).
Handle(func(ctx *zero.Ctx) {
@@ -64,8 +64,7 @@ func init() { // 主函数
ctx.SendChain(message.Text("出现错误捏:", err))
return
}
- km := string(es)
- ctx.SendChain(message.Text(str+"的拼音为:", km))
+ ctx.SendChain(message.Text(str+"的拼音为:", helper.BytesToString(es)))
})
en.OnFullMatch("每日情话").SetBlock(true).
Handle(func(ctx *zero.Ctx) {
@@ -84,8 +83,7 @@ func init() { // 主函数
ctx.SendChain(message.Text("获取失败惹", err))
return
}
- km := string(data)
- ctx.SendChain(message.Text(km))
+ ctx.SendChain(message.Text(helper.BytesToString(data)))
})
en.OnFullMatch("绕口令").SetBlock(true).
Handle(func(ctx *zero.Ctx) {
@@ -94,8 +92,7 @@ func init() { // 主函数
ctx.SendChain(message.Text("获取失败惹", err))
return
}
- km := string(data)
- ctx.SendChain(message.Text(km))
+ ctx.SendChain(message.Text(helper.BytesToString(data)))
})
}
func handle(ctx *zero.Ctx) {
@@ -105,7 +102,11 @@ func handle(ctx *zero.Ctx) {
ctx.SendChain(message.Text("Err:", err))
return
}
- json.Unmarshal(data, &rsp)
+ err = json.Unmarshal(data, &rsp)
+ if err != nil {
+ ctx.SendChain(message.Text("出现错误捏:", err))
+ return
+ }
msg := ""
msg += rsp.Hitokoto + "\n出自:" + rsp.From + "\n"
if len(rsp.FromWho) != 0 {
From c4aec0e638d7b091bec40b739c04bc5fdccc8acb Mon Sep 17 00:00:00 2001
From: lianhong <2758988938@qq.com>
Date: Sat, 5 Nov 2022 01:12:15 +0800
Subject: [PATCH 09/21] 123
---
plugin/wenben/wenben.go | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/plugin/wenben/wenben.go b/plugin/wenben/wenben.go
index fde0a102b3..b303b8c0d4 100644
--- a/plugin/wenben/wenben.go
+++ b/plugin/wenben/wenben.go
@@ -20,18 +20,18 @@ const (
)
type RspData struct {
- Id int `json:"ID"`
- Uuid string `json:"UUID"`
- Hitokoto string `json:"hitokoto"`
- Type string `json:"type"`
- From string `json:"from"`
- FromWho string `json:"from_who"`
- Creator string `json:"creator"`
- CreatorUid int `json:"creator_UID"`
- Reviewer int `json:"reviewer"`
- CommitFrom string `json:"commit_from"`
- CreatedAt string `json:"created_at"`
- Length int `json:"length"`
+ ID int `json:"ID"`
+ UUID string `json:"UUID"`
+ Hitokoto string `json:"hitokoto"`
+ Type string `json:"type"`
+ From string `json:"from"`
+ FromWho string `json:"from_who"`
+ Creator string `json:"creator"`
+ creator_UID int `json:"creator_UID"`
+ Reviewer int `json:"reviewer"`
+ CommitFrom string `json:"commit_from"`
+ CreatedAt string `json:"created_at"`
+ Length int `json:"length"`
}
func init() { // 主函数
From 0b64ea6d0e169ceffaed435f548cbcbeb6e6e777 Mon Sep 17 00:00:00 2001
From: lianhong <2758988938@qq.com>
Date: Sat, 5 Nov 2022 15:52:56 +0800
Subject: [PATCH 10/21] 123
---
README.md | 47 ++++++++++++-----------
plugin/jiami/jiami.go | 68 +++++++++++++++------------------
plugin/wenben/wenben.go | 85 ++++++++++++++++++++---------------------
3 files changed, 96 insertions(+), 104 deletions(-)
diff --git a/README.md b/README.md
index 3f6d17f875..9d426a7c64 100644
--- a/README.md
+++ b/README.md
@@ -485,15 +485,6 @@ print("run[CQ:image,file="+j["img"]+"]")
- [x] 天城文用yyy解密xxx
-
-
- 兽语加密(嗷呜~)
-
- `import _ "github.com/FloatTech/ZeroBot-Plugin/plugin/jiami"`
-
- - [x] 兽语加密xxx
-
- - [x] 兽语解密xxx
@@ -822,6 +813,16 @@ print("run[CQ:image,file="+j["img"]+"]")
- [x] 更新[屌|弔|吊]图
+
+
+ 兽语加密(嗷呜~)
+
+ `import _ "github.com/FloatTech/ZeroBot-Plugin/plugin/jiami"`
+
+ - [x] 兽语加密xxx
+
+ - [x] 兽语解密xxx
+
小鸡词典
@@ -1202,6 +1203,20 @@ print("run[CQ:image,file="+j["img"]+"]")
- [x] 来份网易云热评
+
+
+ 天气/拼音查询-名言
+
+ `import _ "github.com/FloatTech/ZeroBot-Plugin/plugin/wenben"`
+
+ - [x] xx天气
+
+ - [x] xx拼音
+
+ - [x] 每日情话/一言/鸡汤
+
+ - [x] 绕口令
+
百度文心AI
@@ -1270,20 +1285,6 @@ print("run[CQ:image,file="+j["img"]+"]")
- [x] 舔狗日记
-
-
- 天气/拼音查询-名言
-
- `import _ "github.com/FloatTech/ZeroBot-Plugin/plugin/wenben"`
-
- - [x] xx天气
-
- - [x] xx拼音
-
- - [x] 每日情话/一言/鸡汤
-
- - [x] 绕口令
-
聊天热词
diff --git a/plugin/jiami/jiami.go b/plugin/jiami/jiami.go
index bb07ac2d07..6f339a70d6 100644
--- a/plugin/jiami/jiami.go
+++ b/plugin/jiami/jiami.go
@@ -22,7 +22,7 @@ type nmd struct { // struct解析格式大概是
Code int `json:"code"`
Text string `json:"text"`
Data struct {
- Message string `json:"Message"`
+ Message string
} `json:"data"`
}
@@ -32,41 +32,35 @@ func init() { // 主函数
Help: "兽语加解密\n" +
"- 兽语加密xxx\n- 兽语解密xxx",
})
- en.OnRegex(`^兽语加密\s*(.+)$`).SetBlock(true). // 正值输入
- Handle(func(ctx *zero.Ctx) {
- str := ctx.State["regex_matched"].([]string)[1]
- // es := base14.EncodeString(str)
- es, err := web.GetData(fmt.Sprintf(jiami1, str)) // 将网站返回结果赋值
- if err != nil {
- ctx.SendChain(message.Text("出现错误捏:", err))
- return
- }
-
- // es1 := fmt.Sprintf("%s", es)
- var r nmd // r数组
- err = json.Unmarshal(es, &r) // 填api返回结果,struct地址
- if err != nil {
- ctx.SendChain(message.Text("出现错误捏:", err))
- return
- }
- ctx.SendChain(message.Text(r.Data.Message)) // 输出提取后的结果
- })
+ en.OnRegex(`^兽语加密\s*(.+)$`).SetBlock(true).Handle(func(ctx *zero.Ctx) {
+ str := ctx.State["regex_matched"].([]string)[1]
+ es, err := web.GetData(fmt.Sprintf(jiami1, str)) // 将网站返回结果赋值
+ if err != nil {
+ ctx.SendChain(message.Text("出现错误捏:", err))
+ return
+ }
+ var r nmd // r数组
+ err = json.Unmarshal(es, &r) // 填api返回结果,struct地址
+ if err != nil {
+ ctx.SendChain(message.Text("出现错误捏:", err))
+ return
+ }
+ ctx.SendChain(message.Text(r.Data.Message)) // 输出提取后的结果
+ })
- en.OnRegex(`^兽语解密\s*(.+)$`).SetBlock(true). // 正值输入
- Handle(func(ctx *zero.Ctx) {
- str := ctx.State["regex_matched"].([]string)[1]
- // es := base14.EncodeString(str)
- es, err := web.GetData(fmt.Sprintf(jiami2, str)) // 将网站返回结果赋值
- if err != nil {
- ctx.SendChain(message.Text("出现错误捏:", err))
- return
- }
- var n nmd // r数组
- err = json.Unmarshal(es, &n) // 填api返回结果,struct地址
- if err != nil {
- ctx.SendChain(message.Text("出现错误捏:", err))
- return
- }
- ctx.SendChain(message.Text(n.Data.Message)) // 输出提取后的结果
- })
+ en.OnRegex(`^兽语解密\s*(.+)$`).SetBlock(true).Handle(func(ctx *zero.Ctx) {
+ str := ctx.State["regex_matched"].([]string)[1]
+ es, err := web.GetData(fmt.Sprintf(jiami2, str)) // 将网站返回结果赋值
+ if err != nil {
+ ctx.SendChain(message.Text("出现错误捏:", err))
+ return
+ }
+ var n nmd // r数组
+ err = json.Unmarshal(es, &n) // 填api返回结果,struct地址
+ if err != nil {
+ ctx.SendChain(message.Text("出现错误捏:", err))
+ return
+ }
+ ctx.SendChain(message.Text(n.Data.Message)) // 输出提取后的结果
+ })
}
diff --git a/plugin/wenben/wenben.go b/plugin/wenben/wenben.go
index b303b8c0d4..d0c59342a1 100644
--- a/plugin/wenben/wenben.go
+++ b/plugin/wenben/wenben.go
@@ -4,13 +4,13 @@ package wenben
import (
"encoding/json"
"fmt"
-
"github.com/FloatTech/floatbox/web"
ctrl "github.com/FloatTech/zbpctrl"
"github.com/FloatTech/zbputils/control"
zero "github.com/wdvxdr1123/ZeroBot"
"github.com/wdvxdr1123/ZeroBot/message"
"github.com/wdvxdr1123/ZeroBot/utils/helper"
+ "strings"
)
const (
@@ -20,18 +20,17 @@ const (
)
type RspData struct {
- ID int `json:"ID"`
- UUID string `json:"UUID"`
- Hitokoto string `json:"hitokoto"`
- Type string `json:"type"`
- From string `json:"from"`
- FromWho string `json:"from_who"`
- Creator string `json:"creator"`
- creator_UID int `json:"creator_UID"`
- Reviewer int `json:"reviewer"`
- CommitFrom string `json:"commit_from"`
- CreatedAt string `json:"created_at"`
- Length int `json:"length"`
+ ID int `json:"ID"`
+ UUID string `json:"UUID"`
+ Hitokoto string `json:"hitokoto"`
+ Type string `json:"type"`
+ From string `json:"from"`
+ FromWho string `json:"from_who"`
+ Creator string `json:"creator"`
+ Reviewer int `json:"reviewer"`
+ CommitFrom string `json:"commit_from"`
+ CreatedAt string `json:"created_at"`
+ Length int `json:"length"`
}
func init() { // 主函数
@@ -45,7 +44,6 @@ func init() { // 主函数
"- 每日情话" +
"- 绕口令",
})
- en.OnFullMatch("每日一言").SetBlock(true).Handle(handle) //每日一言
en.OnSuffix("天气").SetBlock(true).
Handle(func(ctx *zero.Ctx) {
str := ctx.State["args"].(string)
@@ -54,7 +52,7 @@ func init() { // 主函数
ctx.SendChain(message.Text("出现错误捏:", err))
return
}
- ctx.SendChain(message.Text(str+"天气如下:\n", helper.BytesToString(es)))
+ ctx.SendChain(message.Text(str, "天气如下:\n", helper.BytesToString(es)))
})
en.OnSuffix("拼音").SetBlock(true).
Handle(func(ctx *zero.Ctx) {
@@ -64,7 +62,7 @@ func init() { // 主函数
ctx.SendChain(message.Text("出现错误捏:", err))
return
}
- ctx.SendChain(message.Text(str+"的拼音为:", helper.BytesToString(es)))
+ ctx.SendChain(message.Text(str, "的拼音为:", helper.BytesToString(es)))
})
en.OnFullMatch("每日情话").SetBlock(true).
Handle(func(ctx *zero.Ctx) {
@@ -85,32 +83,31 @@ func init() { // 主函数
}
ctx.SendChain(message.Text(helper.BytesToString(data)))
})
- en.OnFullMatch("绕口令").SetBlock(true).
- Handle(func(ctx *zero.Ctx) {
- data, err := web.GetData("http://ovooa.com/API/rao/api.php?type=text")
- if err != nil {
- ctx.SendChain(message.Text("获取失败惹", err))
- return
- }
- ctx.SendChain(message.Text(helper.BytesToString(data)))
- })
-}
-func handle(ctx *zero.Ctx) {
- var rsp RspData
- data, err := web.GetData(url)
- if err != nil {
- ctx.SendChain(message.Text("Err:", err))
- return
- }
- err = json.Unmarshal(data, &rsp)
- if err != nil {
- ctx.SendChain(message.Text("出现错误捏:", err))
- return
- }
- msg := ""
- msg += rsp.Hitokoto + "\n出自:" + rsp.From + "\n"
- if len(rsp.FromWho) != 0 {
- msg += "作者:" + rsp.FromWho
- }
- ctx.SendChain(message.Text(msg))
+ en.OnFullMatch("绕口令").SetBlock(true).Handle(func(ctx *zero.Ctx) {
+ data, err := web.GetData("http://ovooa.com/API/rao/api.php?type=text")
+ if err != nil {
+ ctx.SendChain(message.Text("获取失败惹", err))
+ return
+ }
+ ctx.SendChain(message.Text(helper.BytesToString(data)))
+ })
+ en.OnFullMatch("每日一言").SetBlock(true).Handle(func(ctx *zero.Ctx) { //每日一言
+ var rsp RspData
+ data, err := web.GetData(url)
+ if err != nil {
+ ctx.SendChain(message.Text("Err:", err))
+ return
+ }
+ err = json.Unmarshal(data, &rsp)
+ if err != nil {
+ ctx.SendChain(message.Text("出现错误捏:", err))
+ return
+ }
+ var msg strings.Builder
+ msg.WriteString(rsp.Hitokoto + "\n出自:" + rsp.From + "\n")
+ if len(rsp.FromWho) != 0 {
+ msg.WriteString("作者:" + rsp.FromWho)
+ }
+ ctx.SendChain(message.Text(msg))
+ })
}
From 076bb749bfcdbe23eff52fac508f3a24bb71d239 Mon Sep 17 00:00:00 2001
From: lianhong <2758988938@qq.com>
Date: Sat, 5 Nov 2022 16:04:11 +0800
Subject: [PATCH 11/21] 123
---
plugin/wenben/wenben.go | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugin/wenben/wenben.go b/plugin/wenben/wenben.go
index d0c59342a1..a25d3db999 100644
--- a/plugin/wenben/wenben.go
+++ b/plugin/wenben/wenben.go
@@ -108,6 +108,6 @@ func init() { // 主函数
if len(rsp.FromWho) != 0 {
msg.WriteString("作者:" + rsp.FromWho)
}
- ctx.SendChain(message.Text(msg))
+ ctx.SendChain(message.Text(msg.String()))
})
}
From 2e87041cf9fd9c5c857e9c827e7af1e8e9be39b1 Mon Sep 17 00:00:00 2001
From: lianhong <2758988938@qq.com>
Date: Sat, 5 Nov 2022 19:58:05 +0800
Subject: [PATCH 12/21] =?UTF-8?q?=E6=9B=B4=E6=96=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
plugin/wenben/wenben.go | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/plugin/wenben/wenben.go b/plugin/wenben/wenben.go
index a25d3db999..b3e9b33339 100644
--- a/plugin/wenben/wenben.go
+++ b/plugin/wenben/wenben.go
@@ -20,10 +20,7 @@ const (
)
type RspData struct {
- ID int `json:"ID"`
- UUID string `json:"UUID"`
Hitokoto string `json:"hitokoto"`
- Type string `json:"type"`
From string `json:"from"`
FromWho string `json:"from_who"`
Creator string `json:"creator"`
@@ -104,9 +101,13 @@ func init() { // 主函数
return
}
var msg strings.Builder
- msg.WriteString(rsp.Hitokoto + "\n出自:" + rsp.From + "\n")
+ msg.WriteString(rsp.Hitokoto)
+ msg.WriteString("\n出自:")
+ msg.WriteString(rsp.From)
+ msg.WriteByte('\n')
if len(rsp.FromWho) != 0 {
- msg.WriteString("作者:" + rsp.FromWho)
+ msg.WriteString("作者:")
+ msg.WriteString(rsp.FromWho)
}
ctx.SendChain(message.Text(msg.String()))
})
From dac37ee4dce23869b2e848e7298eee996e7ad0ae Mon Sep 17 00:00:00 2001
From: lianhong <2758988938@qq.com>
Date: Sat, 5 Nov 2022 20:20:58 +0800
Subject: [PATCH 13/21] 4
---
README.md | 2 +-
plugin/jiami/jiami.go | 3 +--
plugin/wenben/wenben.go | 32 +++++++++++++++-----------------
3 files changed, 17 insertions(+), 20 deletions(-)
diff --git a/README.md b/README.md
index 9d426a7c64..49048419c0 100644
--- a/README.md
+++ b/README.md
@@ -457,6 +457,7 @@ print("run[CQ:image,file="+j["img"]+"]")
- [x] 设置不检测类型[类型编号]
检测类型编号列表:[1:违禁违规|2:文本色情|3:敏感信息|4:恶意推广|5:低俗辱骂|6:恶意推广-联系方式|7:恶意推广-软文推广]
+
base64卦加解密
@@ -485,7 +486,6 @@ print("run[CQ:image,file="+j["img"]+"]")
- [x] 天城文用yyy解密xxx
-
bilibili
diff --git a/plugin/jiami/jiami.go b/plugin/jiami/jiami.go
index 6f339a70d6..290bc02afc 100644
--- a/plugin/jiami/jiami.go
+++ b/plugin/jiami/jiami.go
@@ -19,8 +19,6 @@ const (
)
type nmd struct { // struct解析格式大概是
- Code int `json:"code"`
- Text string `json:"text"`
Data struct {
Message string
} `json:"data"`
@@ -29,6 +27,7 @@ type nmd struct { // struct解析格式大概是
func init() { // 主函数
en := control.Register("jiami", &ctrl.Options[*zero.Ctx]{
DisableOnDefault: false,
+ Brief: "兽语加解密",
Help: "兽语加解密\n" +
"- 兽语加密xxx\n- 兽语解密xxx",
})
diff --git a/plugin/wenben/wenben.go b/plugin/wenben/wenben.go
index b3e9b33339..9bcb6947ac 100644
--- a/plugin/wenben/wenben.go
+++ b/plugin/wenben/wenben.go
@@ -14,25 +14,24 @@ import (
)
const (
- tianqi = "https://xiaobai.klizi.cn/API/other/weather_1.php?data=&msg=%v" // api地址
- pinyin = "http://ovooa.com/API/pinyin/api.php?type=text&msg=%v"
- url = "https://v1.hitokoto.cn/?c=a&c=b&c=c&c=d&c=h&c=i" // 动漫 漫画 游戏 文学 影视 诗词
+ tianqi = "https://xiaobai.klizi.cn/API/other/weather_1.php?data=&msg=%v" // api地址
+ pinyin = "http://ovooa.com/API/pinyin/api.php?type=text&msg=%v"
+ yiyan = "https://v1.hitokoto.cn/?c=a&c=b&c=c&c=d&c=h&c=i" // 动漫 漫画 游戏 文学 影视 诗词
+ kouling = "http://ovooa.com/API/rao/api.php?type=text" //口令
+ tang = "http://api.btstu.cn/yan/api.php?charset=utf-8&encode=text"
+ qing = "https://xiaobai.klizi.cn/API/other/wtqh.php"
)
type RspData struct {
- Hitokoto string `json:"hitokoto"`
- From string `json:"from"`
- FromWho string `json:"from_who"`
- Creator string `json:"creator"`
- Reviewer int `json:"reviewer"`
- CommitFrom string `json:"commit_from"`
- CreatedAt string `json:"created_at"`
- Length int `json:"length"`
+ Hitokoto string `json:"hitokoto"`
+ From string `json:"from"`
+ FromWho string `json:"from_who"`
}
func init() { // 主函数
en := control.Register("tianqi", &ctrl.Options[*zero.Ctx]{
DisableOnDefault: false,
+ Brief: "天气/拼音查询",
Help: "文本命令大全\n" +
"- 天气查询:xxx天气" +
"- 拼音查询:xxx拼音" +
@@ -63,17 +62,16 @@ func init() { // 主函数
})
en.OnFullMatch("每日情话").SetBlock(true).
Handle(func(ctx *zero.Ctx) {
- data, err := web.GetData("https://xiaobai.klizi.cn/API/other/wtqh.php")
+ data, err := web.GetData(qing)
if err != nil {
ctx.SendChain(message.Text("获取失败惹", err))
return
}
- km := fmt.Sprintf("%s", data)
- ctx.SendChain(message.Text(km))
+ ctx.SendChain(message.Text(helper.BytesToString(data)))
})
en.OnFullMatch("每日鸡汤").SetBlock(true).
Handle(func(ctx *zero.Ctx) {
- data, err := web.GetData("http://api.btstu.cn/yan/api.php?charset=utf-8&encode=text")
+ data, err := web.GetData(tang)
if err != nil {
ctx.SendChain(message.Text("获取失败惹", err))
return
@@ -81,7 +79,7 @@ func init() { // 主函数
ctx.SendChain(message.Text(helper.BytesToString(data)))
})
en.OnFullMatch("绕口令").SetBlock(true).Handle(func(ctx *zero.Ctx) {
- data, err := web.GetData("http://ovooa.com/API/rao/api.php?type=text")
+ data, err := web.GetData(kouling)
if err != nil {
ctx.SendChain(message.Text("获取失败惹", err))
return
@@ -90,7 +88,7 @@ func init() { // 主函数
})
en.OnFullMatch("每日一言").SetBlock(true).Handle(func(ctx *zero.Ctx) { //每日一言
var rsp RspData
- data, err := web.GetData(url)
+ data, err := web.GetData(yiyan)
if err != nil {
ctx.SendChain(message.Text("Err:", err))
return
From 47f61cf76836ba25e433551d143ea996e490eb64 Mon Sep 17 00:00:00 2001
From: lianhong <2758988938@qq.com>
Date: Sat, 5 Nov 2022 21:57:59 +0800
Subject: [PATCH 14/21] 5
---
README.md | 1 -
1 file changed, 1 deletion(-)
diff --git a/README.md b/README.md
index 49048419c0..78bfa2d8f4 100644
--- a/README.md
+++ b/README.md
@@ -457,7 +457,6 @@ print("run[CQ:image,file="+j["img"]+"]")
- [x] 设置不检测类型[类型编号]
检测类型编号列表:[1:违禁违规|2:文本色情|3:敏感信息|4:恶意推广|5:低俗辱骂|6:恶意推广-联系方式|7:恶意推广-软文推广]
-
base64卦加解密
From df0198d222b399eed82ffe58dd9df540d8bfad25 Mon Sep 17 00:00:00 2001
From: lianhong <2758988938@qq.com>
Date: Sat, 5 Nov 2022 22:13:39 +0800
Subject: [PATCH 15/21] =?UTF-8?q?=E7=BB=A7=E7=BB=AD=E5=AE=8C=E5=96=84...?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
plugin/wenben/wenben.go | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/plugin/wenben/wenben.go b/plugin/wenben/wenben.go
index 9bcb6947ac..fa9233adf9 100644
--- a/plugin/wenben/wenben.go
+++ b/plugin/wenben/wenben.go
@@ -22,7 +22,7 @@ const (
qing = "https://xiaobai.klizi.cn/API/other/wtqh.php"
)
-type RspData struct {
+type rspData struct {
Hitokoto string `json:"hitokoto"`
From string `json:"from"`
FromWho string `json:"from_who"`
@@ -87,7 +87,7 @@ func init() { // 主函数
ctx.SendChain(message.Text(helper.BytesToString(data)))
})
en.OnFullMatch("每日一言").SetBlock(true).Handle(func(ctx *zero.Ctx) { //每日一言
- var rsp RspData
+ var rsp rspData
data, err := web.GetData(yiyan)
if err != nil {
ctx.SendChain(message.Text("Err:", err))
From ef6737832253da42ce02e865792dcf0fe82ed23b Mon Sep 17 00:00:00 2001
From: lianhong <2758988938@qq.com>
Date: Tue, 8 Nov 2022 18:02:40 +0800
Subject: [PATCH 16/21] =?UTF-8?q?=E6=9D=83=E9=87=8D=E6=9F=A5=E8=AF=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
plugin/wenben/wenben.go | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/plugin/wenben/wenben.go b/plugin/wenben/wenben.go
index fa9233adf9..8a5392ecf0 100644
--- a/plugin/wenben/wenben.go
+++ b/plugin/wenben/wenben.go
@@ -20,6 +20,7 @@ const (
kouling = "http://ovooa.com/API/rao/api.php?type=text" //口令
tang = "http://api.btstu.cn/yan/api.php?charset=utf-8&encode=text"
qing = "https://xiaobai.klizi.cn/API/other/wtqh.php"
+ quan = "http://tfkapi.top/API/qqqz.php?qq=%v"
)
type rspData struct {
@@ -109,4 +110,16 @@ func init() { // 主函数
}
ctx.SendChain(message.Text(msg.String()))
})
+ en.OnRegex(`^权重查询\s?(\S{0,25})$`).SetBlock(true).Handle(func(ctx *zero.Ctx) {
+ str := ctx.State["regex_matched"].([]string)[1]
+ if str == "" {
+ str = strconv.FormatInt(ctx.Event.UserID, 10)
+ }
+ es, err := web.GetData(fmt.Sprintf(quan, str)) // 将网站返回结果赋值
+ if err != nil {
+ ctx.SendChain(message.Text("出现错误捏:", err))
+ return
+ }
+ ctx.SendChain(message.Text(str, helper.BytesToString(es))) // 输出提取后的结果
+ })
}
From ef7f2ec41a1aca2708582eeff2d8273ea8eb2620 Mon Sep 17 00:00:00 2001
From: lianhong <2758988938@qq.com>
Date: Tue, 8 Nov 2022 18:03:16 +0800
Subject: [PATCH 17/21] =?UTF-8?q?=E6=9D=83=E9=87=8D=E6=9F=A5=E8=AF=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
plugin/wenben/wenben.go | 1 +
1 file changed, 1 insertion(+)
diff --git a/plugin/wenben/wenben.go b/plugin/wenben/wenben.go
index 8a5392ecf0..ccc5d84833 100644
--- a/plugin/wenben/wenben.go
+++ b/plugin/wenben/wenben.go
@@ -4,6 +4,7 @@ package wenben
import (
"encoding/json"
"fmt"
+ "strconv"
"github.com/FloatTech/floatbox/web"
ctrl "github.com/FloatTech/zbpctrl"
"github.com/FloatTech/zbputils/control"
From b0c4d8b91d3d9e361f07e7708a9422b545108e95 Mon Sep 17 00:00:00 2001
From: lianhong <2758988938@qq.com>
Date: Sat, 12 Nov 2022 18:22:00 +0800
Subject: [PATCH 18/21] =?UTF-8?q?=E6=9B=B4=E6=AD=A3=E6=8F=92=E4=BB=B6?=
=?UTF-8?q?=E6=B3=A8=E5=86=8C=E5=90=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
plugin/wenben/wenben.go | 15 +--------------
1 file changed, 1 insertion(+), 14 deletions(-)
diff --git a/plugin/wenben/wenben.go b/plugin/wenben/wenben.go
index ccc5d84833..2211fe9a1b 100644
--- a/plugin/wenben/wenben.go
+++ b/plugin/wenben/wenben.go
@@ -4,7 +4,6 @@ package wenben
import (
"encoding/json"
"fmt"
- "strconv"
"github.com/FloatTech/floatbox/web"
ctrl "github.com/FloatTech/zbpctrl"
"github.com/FloatTech/zbputils/control"
@@ -31,7 +30,7 @@ type rspData struct {
}
func init() { // 主函数
- en := control.Register("tianqi", &ctrl.Options[*zero.Ctx]{
+ en := control.Register("wenben", &ctrl.Options[*zero.Ctx]{
DisableOnDefault: false,
Brief: "天气/拼音查询",
Help: "文本命令大全\n" +
@@ -111,16 +110,4 @@ func init() { // 主函数
}
ctx.SendChain(message.Text(msg.String()))
})
- en.OnRegex(`^权重查询\s?(\S{0,25})$`).SetBlock(true).Handle(func(ctx *zero.Ctx) {
- str := ctx.State["regex_matched"].([]string)[1]
- if str == "" {
- str = strconv.FormatInt(ctx.Event.UserID, 10)
- }
- es, err := web.GetData(fmt.Sprintf(quan, str)) // 将网站返回结果赋值
- if err != nil {
- ctx.SendChain(message.Text("出现错误捏:", err))
- return
- }
- ctx.SendChain(message.Text(str, helper.BytesToString(es))) // 输出提取后的结果
- })
}
From a68a7c7555df6e97133b1e3fc09a8a453b647229 Mon Sep 17 00:00:00 2001
From: lianhong <2758988938@qq.com>
Date: Sat, 12 Nov 2022 18:26:26 +0800
Subject: [PATCH 19/21] =?UTF-8?q?=E6=9B=B4=E6=AD=A3=E5=90=8D=E7=A7=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
plugin/wenben/wenben.go | 1 -
1 file changed, 1 deletion(-)
diff --git a/plugin/wenben/wenben.go b/plugin/wenben/wenben.go
index 2211fe9a1b..63cc862449 100644
--- a/plugin/wenben/wenben.go
+++ b/plugin/wenben/wenben.go
@@ -20,7 +20,6 @@ const (
kouling = "http://ovooa.com/API/rao/api.php?type=text" //口令
tang = "http://api.btstu.cn/yan/api.php?charset=utf-8&encode=text"
qing = "https://xiaobai.klizi.cn/API/other/wtqh.php"
- quan = "http://tfkapi.top/API/qqqz.php?qq=%v"
)
type rspData struct {
From ef67b4e62bfa000df2703f81ab6b3d346c1bec7a Mon Sep 17 00:00:00 2001
From: lianhong <2758988938@qq.com>
Date: Tue, 15 Nov 2022 22:59:45 +0800
Subject: [PATCH 20/21] =?UTF-8?q?QQ=E6=9D=83=E9=87=8D=E6=9F=A5=E8=AF=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
README.md | 11 +++++++++++
main.go | 1 +
plugin/quan/quan.go | 40 ++++++++++++++++++++++++++++++++++++++++
3 files changed, 52 insertions(+)
create mode 100644 plugin/quan/quan.go
diff --git a/README.md b/README.md
index 47bdf7b39e..7ae87ee0ee 100644
--- a/README.md
+++ b/README.md
@@ -1072,6 +1072,17 @@ print("run[CQ:image,file="+j["img"]+"]")
- [x] 重置花名册
+
+
+ 权重查询
+
+ `import _ "github.com/FloatTech/ZeroBot-Plugin/plugin/quan"`
+
+ - 来看看大家的账号分吧~据说越高越不容易封号哦
+
+ - [x] 权重查询+@xxx
+
+ - [x] 权重查询+QQ号(为空时匹配触发者QQ)
diff --git a/main.go b/main.go
index dc32421d99..97efa0f95a 100644
--- a/main.go
+++ b/main.go
@@ -114,6 +114,7 @@ import (
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/nsfw" // nsfw图片识别
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/omikuji" // 浅草寺求签
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/qqwife" // 一群一天一夫一妻制群老婆
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/quan" // QQ权重查询
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/realcugan" // realcugan清晰术
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/reborn" // 投胎
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/runcode" // 在线运行代码
diff --git a/plugin/quan/quan.go b/plugin/quan/quan.go
new file mode 100644
index 0000000000..2ad704d9bb
--- /dev/null
+++ b/plugin/quan/quan.go
@@ -0,0 +1,40 @@
+// Package quan qq权重查询
+package quan
+
+import (
+ "fmt"
+ "github.com/FloatTech/floatbox/web"
+ ctrl "github.com/FloatTech/zbpctrl"
+ "github.com/FloatTech/zbputils/control"
+ zero "github.com/wdvxdr1123/ZeroBot"
+ "github.com/wdvxdr1123/ZeroBot/message"
+ "github.com/wdvxdr1123/ZeroBot/utils/helper"
+ "strconv"
+)
+
+const (
+ quan = "http://tfkapi.top/API/qqqz.php?qq=%v" // api
+)
+
+func init() { // 主函数
+ en := control.Register("quan", &ctrl.Options[*zero.Ctx]{
+ DisableOnDefault: false,
+ Brief: "QQ权重查询",
+ Help: "权重查询方式\n" +
+ "- 权重查询+@xxx" +
+ "- 权重查询+QQ号(可以不写,默认本人)",
+ })
+ en.OnRegex(`^权重查询\s*(\[CQ:at,qq=)?(\d{0,12})`).SetBlock(true).Handle(func(ctx *zero.Ctx) {
+ str := ctx.State["regex_matched"].([]string)[2] //获取uid
+ if str == "" { //user
+ str = strconv.FormatInt(ctx.Event.UserID, 10)
+ }
+ es, err := web.GetData(fmt.Sprintf(quan, str)) // 将网站返回结果赋值
+ if err != nil {
+ ctx.SendChain(message.Text("出现错误捏:", err))
+ return
+ }
+ ctx.SendChain(message.Text(str, helper.BytesToString(es))) // 输出结果
+ })
+
+}
From 7ba6a8b4d7b80dd658d2fd69f585c5455165ef4e Mon Sep 17 00:00:00 2001
From: lianhong <2758988938@qq.com>
Date: Wed, 16 Nov 2022 22:56:46 +0800
Subject: [PATCH 21/21] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=AD=A3=E5=88=99?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
plugin/quan/quan.go | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugin/quan/quan.go b/plugin/quan/quan.go
index 2ad704d9bb..252d89c7e8 100644
--- a/plugin/quan/quan.go
+++ b/plugin/quan/quan.go
@@ -24,7 +24,7 @@ func init() { // 主函数
"- 权重查询+@xxx" +
"- 权重查询+QQ号(可以不写,默认本人)",
})
- en.OnRegex(`^权重查询\s*(\[CQ:at,qq=)?(\d{0,12})`).SetBlock(true).Handle(func(ctx *zero.Ctx) {
+ en.OnRegex(`^权重查询\s*(\[CQ:at,qq=)?(\d+)?`).SetBlock(true).Handle(func(ctx *zero.Ctx) {
str := ctx.State["regex_matched"].([]string)[2] //获取uid
if str == "" { //user
str = strconv.FormatInt(ctx.Event.UserID, 10)