Skip to content

Commit a2426de

Browse files
committed
Squashed commit of the following:
commit 3e4b0216b9f952b800e9be880acd744af3afe593 Merge: 970cb14 aaf832e Author: fumiama <[email protected]> Date: Sat Feb 12 23:23:51 2022 +0800 Merge branch 'master' of https://github.com/MoYoez/ZeroBot-Plugin into MoYoez-master commit 970cb14 Author: fumiama <[email protected]> Date: Sat Feb 12 23:18:23 2022 +0800 ✨ 🐛 🔥 ⚡️ 🎨 fix: gif panic commit aaf832e Author: MoeMagicMango <[email protected]> Date: Sat Feb 12 21:06:21 2022 +0800 Update chat.go commit fae3458 Author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat Feb 12 13:05:37 2022 +0000 🎨 改进代码样式 commit 610cae5 Author: MoeMagicMango <[email protected]> Date: Sat Feb 12 21:05:08 2022 +0800 Update chat.go commit c445c61 Author: MoeMagicMango <[email protected]> Date: Sat Feb 12 20:58:57 2022 +0800 Delete data.go commit 70172f4 Author: MoeMagicMango <[email protected]> Date: Sat Feb 12 20:53:10 2022 +0800 换了个网易云音乐热评的API commit c8b4827 Author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat Feb 12 12:50:57 2022 +0000 🎨 改进代码样式 commit a233586 Author: MoeMagicMango <[email protected]> Date: Sat Feb 12 20:50:21 2022 +0800 Update chat.go commit 87501f6 Author: MoeMagicMango <[email protected]> Date: Sat Feb 12 20:49:08 2022 +0800 Update data.go commit ecf6419 Author: MoeMagicMango <[email protected]> Date: Sat Feb 12 20:48:14 2022 +0800 Update chat.go commit c355050 Author: MoeMagicMango <[email protected]> Date: Sat Feb 12 20:47:47 2022 +0800 Delete plugin_purechat directory commit 1da3486 Author: MoeMagicMango <[email protected]> Date: Sat Feb 12 20:46:34 2022 +0800 Add files via upload commit 34ed8c8 Author: MoeMagicMango <[email protected]> Date: Sat Feb 12 20:38:46 2022 +0800 Update main.go commit aa08eb0 Author: MoeMagicMango <[email protected]> Date: Sat Feb 12 20:38:19 2022 +0800 修改过的回复 删掉了一些ex的词汇 commit faf1982 Author: MoeMagicMango <[email protected]> Date: Sat Feb 12 20:29:59 2022 +0800 Update main.go commit 5ac3b7a Author: MoeMagicMango <[email protected]> Date: Sat Feb 12 20:28:48 2022 +0800 Update chat.go commit b046d45 Author: MoeMagicMango <[email protected]> Date: Sat Feb 12 20:25:23 2022 +0800 Rename purechat.go to chat.go commit 6bbcdfc Author: MoeMagicMango <[email protected]> Date: Sat Feb 12 20:24:54 2022 +0800 Add files via upload commit e7630b5 Author: MoeMagicMango <[email protected]> Date: Sat Feb 12 20:24:32 2022 +0800 Update purechat.go commit 36c903b Author: MoeMagicMango <[email protected]> Date: Sat Feb 12 20:23:01 2022 +0800 Create purechat.go
1 parent ed7bbf5 commit a2426de

File tree

6 files changed

+49
-24
lines changed

6 files changed

+49
-24
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ zerobot [-h] [-t token] [-u url] [-n nickname] [-p prefix] [-d|w] [-g 监听地
7272
- [x] 空调关
7373
- [x] 群温度
7474
- [x] 设置温度[正整数]
75-
- [x] @Bot mua | 啾咪 | 摸 | 上你 | 傻 | 裸 | 贴 | 老婆 | 抱 | 亲 | 一下 | 咬 | 操 | 123 | 进去 | 调教 | 搓 | 让 | 捏 | 挤 | 略 | 呐 | 原味 | 胖次 | 内裤 | 内衣 | 衣服 | ghs | 批 | 憨批 | kkp | 咕 | 骚 | 喜欢 | suki | 好き | 看 | 不能 | 砸了 | 透 | 口我 | 草我 | 自慰 | onani | オナニー | 炸了 | 色图 | 涩图 | 告白 | 对不起 | 回来 | 吻 | 软 | 壁咚 | 掰开 | 女友 | 是 | 喵 | 嗷呜 | 叫 | 拜 | 佬 | awsl | 臭 | 香 | 腿 | 张开 | 脚 | 脸 | 头发 | 手 | pr | 舔 | 小穴 | 腰 | 诶嘿嘿 | 可爱 | 扭蛋 | 鼻 | 眼 | 色气 | 推 | 床 | 举 | 手冲 | 饿 | 变 | 敲 | 爬 | 怕 | 冲 | 射 | 不穿 | 迫害 | 猫粮 | 揪尾巴 | 薄荷 | 早 | 晚安 | 揉 | 榨 | 掐 | 胸 | 奶子 | 欧派 | 嫩 | 蹭 | 牵手 | 握手 | 拍照 | w | 睡不着 | 欧尼酱 | 哥 | 爱你 | 过来 | 自闭 | 打不过 | 么么哒 | 很懂 | 膝枕 | 累了 | 安慰 | 洗澡 | 一起睡觉 | 一起 | 多大 | 姐姐 | 糖 | 嗦 | 牛子 | 🐂子 | 🐮子 | 嫌弃 | 紧 | baka | 笨蛋 | 插 | 插进来 | 屁股 | 翘 | 翘起来 | 抬 | 抬起 | 爸 | 傲娇 | rua | 咕噜咕噜 | 咕噜 | 上床 | 做爱 | 吃掉 | 吃 | 揪 | 种草莓 | 种草 | 掀 | 妹 | 病娇 | 嘻
75+
- **词典匹配回复** `import _ "github.com/FloatTech/ZeroBot-Plugin/plugin_thesaurus"`
76+
- [x] @Bot 关键词
7677
- **ATRI** `import _ "github.com/FloatTech/ZeroBot-Plugin/plugin_atri"`
7778
- [x] 具体指令看 /用法 atri
7879
- 注:本插件基于 [ATRI](https://github.com/Kyomotoi/ATRI) ,为 Golang 移植版

main.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ import (
3030

3131
_ "github.com/FloatTech/ZeroBot-Plugin/plugin_manager" // 群管
3232

33+
_ "github.com/FloatTech/ZeroBot-Plugin/plugin_thesaurus" // 词典匹配回复
34+
3335
// ^^^^ //
3436
// ^^^^^^^^^^^^^^ //
3537
// ^^^^^^^高优先级区^^^^^^^ //

plugin_chat/chat.go

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,17 @@ import (
1414
"github.com/FloatTech/zbputils/control/order"
1515
)
1616

17-
const (
18-
dbpath = "data/Chat/"
19-
dbfile = dbpath + "kimoi.json"
20-
)
21-
2217
var (
2318
poke = rate.NewManager(time.Minute*5, 8) // 戳一戳
2419
engine = control.Register("chat", order.AcquirePrio(), &control.Options{
2520
DisableOnDefault: false,
26-
Help: "chat\n- [BOT名字]\n- [戳一戳BOT]\n- 空调开\n- 空调关\n- 群温度\n- 设置温度[正整数]\n- mua | 啾咪 | 摸 | 上你 | 傻 | 裸 | 贴 | 老婆 | 抱 | 亲 | 一下 | 咬 | 操 | 123 | 进去 | 调教 | 搓 | 让 | 捏 | 挤 | 略 | 呐 | 原味 | 胖次 | 内裤 | 内衣 | 衣服 | ghs | 批 | 憨批 | kkp | 咕 | 骚 | 喜欢 | suki | 好き | 看 | 不能 | 砸了 | 透 | 口我 | 草我 | 自慰 | onani | オナニー | 炸了 | 色图 | 涩图 | 告白 | 对不起 | 回来 | 吻 | 软 | 壁咚 | 掰开 | 女友 | 是 | 喵 | 嗷呜 | 叫 | 拜 | 佬 | awsl | 臭 | 香 | 腿 | 张开 | 脚 | 脸 | 头发 | 手 | pr | 舔 | 小穴 | 腰 | 诶嘿嘿 | 可爱 | 扭蛋 | 鼻 | 眼 | 色气 | 推 | 床 | 举 | 手冲 | 饿 | 变 | 敲 | 爬 | 怕 | 冲 | 射 | 不穿 | 迫害 | 猫粮 | 揪尾巴 | 薄荷 | 早 | 晚安 | 揉 | 榨 | 掐 | 胸 | 奶子 | 欧派 | 嫩 | 蹭 | 牵手 | 握手 | 拍照 | w | 睡不着 | 欧尼酱 | 哥 | 爱你 | 过来 | 自闭 | 打不过 | 么么哒 | 很懂 | 膝枕 | 累了 | 安慰 | 洗澡 | 一起睡觉 | 一起 | 多大 | 姐姐 | 糖 | 嗦 | 牛子 | 🐂子 | 🐮子 | 嫌弃 | 紧 | baka | 笨蛋 | 插 | 插进来 | 屁股 | 翘 | 翘起来 | 抬 | 抬起 | 爸 | 傲娇 | rua | 咕噜咕噜 | 咕噜 | 上床 | 做爱 | 吃掉 | 吃 | 揪 | 种草莓 | 种草 | 掀 | 妹 | 病娇 | 嘻",
21+
Help: "chat\n- [BOT名字]\n- [戳一戳BOT]\n- 空调开\n- 空调关\n- 群温度\n- 设置温度[正整数]",
2722
})
28-
kimomap = make(kimo, 256)
29-
chatList = make([]string, 0, 256)
3023
)
3124

3225
func init() { // 插件主体
3326
// 被喊名字
34-
engine.OnFullMatch("", zero.OnlyToMe).SetBlock(true).
27+
engine.OnMessage(zero.OnlyToMe).SetBlock(true).
3528
Handle(func(ctx *zero.Ctx) {
3629
var nickname = zero.BotConfig.NickName[0]
3730
time.Sleep(time.Second * 1)
@@ -111,13 +104,4 @@ func init() { // 插件主体
111104
))
112105
}
113106
})
114-
initChatList(func() {
115-
engine.OnFullMatchGroup(chatList, zero.OnlyToMe).SetBlock(true).Handle(
116-
func(ctx *zero.Ctx) {
117-
key := ctx.MessageString()
118-
val := *kimomap[key]
119-
text := val[rand.Intn(len(val))]
120-
ctx.SendChain(message.Reply(ctx.Event.MessageID), message.Text(text))
121-
})
122-
})
123107
}

plugin_thesaurus/chat.go

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// Package thesaurus 修改过的单纯回复插件
2+
package thesaurus
3+
4+
import (
5+
"math/rand"
6+
7+
control "github.com/FloatTech/zbputils/control"
8+
zero "github.com/wdvxdr1123/ZeroBot"
9+
"github.com/wdvxdr1123/ZeroBot/message"
10+
11+
"github.com/FloatTech/zbputils/control/order"
12+
)
13+
14+
const (
15+
dbpath = "data/Chat/"
16+
dbfile = dbpath + "kimoi.json"
17+
)
18+
19+
var (
20+
engine = control.Register("thesaurus", order.AcquirePrio(), &control.Options{
21+
DisableOnDefault: false,
22+
Help: "thesaurus\n- 词典匹配回复",
23+
})
24+
kimomap = make(kimo, 256)
25+
chatList = make([]string, 0, 256)
26+
)
27+
28+
func init() {
29+
initThesaurusList(func() {
30+
engine.OnFullMatchGroup(chatList, zero.OnlyToMe).SetBlock(true).Handle(
31+
func(ctx *zero.Ctx) {
32+
key := ctx.MessageString()
33+
val := *kimomap[key]
34+
text := val[rand.Intn(len(val))]
35+
ctx.SendChain(message.Reply(ctx.Event.MessageID), message.Text(text)) // 来自于 https://github.com/Kyomotoi/AnimeThesaurus 的回复 经过二次修改
36+
})
37+
})
38+
}

plugin_chat/data.go renamed to plugin_thesaurus/data.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package chat
1+
package thesaurus
22

33
import (
44
"encoding/json"
@@ -14,7 +14,7 @@ import (
1414

1515
type kimo = map[string]*[]string
1616

17-
func initChatList(postinit func()) {
17+
func initThesaurusList(postinit func()) {
1818
go func() {
1919
defer order.DoneOnExit()()
2020
process.SleepAbout1sTo2s()
@@ -30,7 +30,7 @@ func initChatList(postinit func()) {
3030
for k := range kimomap {
3131
chatList = append(chatList, k)
3232
}
33-
logrus.Infoln("[chat]加载", len(chatList), "条kimoi")
33+
logrus.Infoln("[thesaurus]加载", len(chatList), "条kimoi")
3434
postinit()
3535
}()
3636
}

plugin_wangyiyun/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import (
1313
)
1414

1515
const (
16-
wangyiyunURL = "http://ovooa.com/API/wyrp/api.php?type=text"
17-
wangyiyunReferer = "http://ovooa.com/"
16+
wangyiyunURL = "https://api.gmit.vip/Api/HotComments?format=text"
17+
wangyiyunReferer = "https://api.gmit.vip/"
1818
ua = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36"
1919
)
2020

0 commit comments

Comments
 (0)