@@ -57,10 +57,11 @@ object Pixiv : KotlinPlugin(
57
57
58
58
59
59
globalEventChannel().subscribeGroupMessages {
60
+
60
61
// 测试成功
61
62
val getDetailOfId: Pattern =
62
63
Pattern .compile(" (?i)^(${Command .getDetailOfId} )([0-9]*[1-9][0-9]*)|-([0-9]*[1-9][0-9]*)\$ " )
63
- content { getDetailOfId.matcher(message.contentToString()).find() } quoteReply {
64
+ content { getDetailOfId.matcher(message.contentToString()).find() && ! Setting .black.contains(group.id.toString()) } quoteReply {
64
65
PicDetails .load(
65
66
this
66
67
)
@@ -69,74 +70,75 @@ object Pixiv : KotlinPlugin(
69
70
// 测试成功
70
71
val rank: Pattern =
71
72
Pattern .compile(" (?i)^(${Command .showRank} )(daily|weekly|monthly|rookie|original|male|female|daily_r18|weekly_r18|male_r18|female_r18|r18g)-([0-9]*[1-9][0-9]*)\$ " )
72
- content { rank.matcher(message.contentToString()).find() } quoteReply { Rank .showRank(this ) }
73
+ content { rank.matcher(message.contentToString()).find() && ! Setting .black.contains(group.id.toString()) } quoteReply { Rank .showRank(this ) }
73
74
74
75
// 测试成功
75
76
val findUserWorksById: Pattern =
76
77
Pattern .compile(" (?i)^(${Command .findUserWorksById} )([0-9]*[1-9][0-9]*)|-([0-9]*[1-9][0-9]*)\$ " )
77
78
content {
78
- findUserWorksById.matcher(message.contentToString()).find()
79
+ findUserWorksById.matcher(message.contentToString()).find() && ! Setting .black.contains(group.id.toString())
79
80
} quoteReply { UserDetails .findUserWorksById(this ) }
80
81
// 测试成功
81
82
val searchInfoByPic: Pattern = Pattern .compile(" (?i)^(${Command .searchInfoByPic} ).+$" )
82
- content { searchInfoByPic.matcher(message.contentToString()).find() } quoteReply {
83
+ content { searchInfoByPic.matcher(message.contentToString()).find() && ! Setting .black.contains(group.id.toString()) } quoteReply {
83
84
Trace .searchInfoByPic(
84
85
this
85
86
)
86
87
}
87
88
88
- content { message.contentToString().contains(" 检测" ) } reply { Nsfw .load(this ) }
89
+ content { message.contentToString().contains(" 检测" ) && ! Setting .black.contains(group.id.toString()) } reply { Nsfw .load(this ) }
89
90
90
91
val setu: Pattern = Pattern .compile(" (?i)^(${Command .setu} )\$ " )
91
- content { setu.matcher(message.contentToString()).find() } reply { SexyCenter .init (this ) }
92
+ content { setu.matcher(message.contentToString()).find() && ! Setting .black.contains(group.id.toString()) } reply { SexyCenter .init (this ) }
92
93
93
94
val setuTag: Pattern = Pattern .compile(" (?i)^(${Command .setu} )[ ]{1}[\\ S]*[ ]?(r18)?\$ " )
94
- content { setuTag.matcher(message.contentToString()).find()} reply { SexyCenter .yandeTagSearch(this ) }
95
+ content { setuTag.matcher(message.contentToString()).find() && ! Setting .black.contains(group.id.toString()) } reply { SexyCenter .yandeTagSearch(this ) }
95
96
96
97
// 测试成功
97
98
val tag: Pattern = Pattern .compile(" (?i)^(${Command .tag} )([\\ s\\ S]*)-([0-9]*[1-9][0-9]*)\$ " )
98
- content { tag.matcher(message.contentToString()).find() } quoteReply { Tag .init (this ) }
99
+ content { tag.matcher(message.contentToString()).find() && ! Setting .black.contains(group.id.toString()) } quoteReply { Tag .init (this ) }
99
100
// 测试成功
100
101
val picToSearch: Pattern = Pattern .compile(" (?i)^(${Command .picToSearch} )(\\ n){0,1}.+$" )
101
102
content {
102
- picToSearch.matcher(message.contentToString()).find()
103
+ picToSearch.matcher(message.contentToString()).find() && ! Setting .black.contains(group.id.toString())
103
104
} quoteReply { SearchPicCenter .forward(this ) }
104
105
105
106
val lolicon: Pattern = Pattern .compile(" (?i)^(${Command .lolicon} )( ([^ ]*)( (r18))?)?\$ " )
106
- content { lolicon.matcher(message.contentToString()).find() } quoteReply { LoliconCenter .load(this ) }
107
+ content { lolicon.matcher(message.contentToString()).find() && ! Setting .black.contains(group.id.toString()) } quoteReply { LoliconCenter .load(this ) }
107
108
108
- content { Command .help.contentEquals(message.contentToString()) } quoteReply { Helper .load(this ) }
109
+ content { Command .help.contentEquals(message.contentToString()) && ! Setting .black.contains(group.id.toString()) } quoteReply { Helper .load(this ) }
109
110
110
- content { " 切换涩图开关" .contentEquals(message.contentToString()) } quoteReply { Helper .setuEnable(this ) }
111
- content { " 切换缓存开关" .contentEquals(message.contentToString()) } quoteReply { Helper .enableLocal(this ) }
112
- content { " 切换转发开关" .contentEquals(message.contentToString()) } quoteReply { Helper .enableForward(this ) }
113
- content { " 切换图片转发开关" .contentEquals(message.contentToString()) } quoteReply {
111
+ content { " 切换涩图开关" .contentEquals(message.contentToString()) && ! Setting .black.contains(group.id.toString()) } quoteReply { Helper .setuEnable(this ) }
112
+ content { " 切换缓存开关" .contentEquals(message.contentToString()) && ! Setting .black.contains(group.id.toString()) } quoteReply { Helper .enableLocal(this ) }
113
+ content { " 切换转发开关" .contentEquals(message.contentToString()) && ! Setting .black.contains(group.id.toString()) } quoteReply { Helper .enableForward(this ) }
114
+ content { " ban" .contentEquals(message.contentToString()) or " unban" .contentEquals(message.contentToString())} quoteReply { Helper .black(this ) }
115
+ content { " 切换图片转发开关" .contentEquals(message.contentToString()) && ! Setting .black.contains(group.id.toString()) } quoteReply {
114
116
Helper .enableImageToForward(
115
117
this
116
118
)
117
119
}
118
- content { " 切换晶格化开关" .contentEquals(message.contentToString()) } quoteReply {
120
+ content { " 切换晶格化开关" .contentEquals(message.contentToString()) && ! Setting .black.contains(group.id.toString()) } quoteReply {
119
121
Helper .enableLowPoly(
120
122
this
121
123
)
122
124
}
123
- content { message.contentToString().contains(" 设置撤回" ) } quoteReply {
125
+ content { message.contentToString().contains(" 设置撤回" ) && ! Setting .black.contains(group.id.toString()) } quoteReply {
124
126
Helper .changeRecall(
125
127
this
126
128
)
127
129
}
128
130
129
131
val vip = Pattern .compile(" (?i)^(购买)(月费|季度|半年|年费)会员\$ " )
130
- content { vip.matcher(message.contentToString()).find() } quoteReply {Vip .buy(this )}
132
+ content { vip.matcher(message.contentToString()).find() && ! Setting .black.contains(group.id.toString()) } quoteReply {Vip .buy(this )}
131
133
132
134
val enableSetu = Pattern .compile(" (?i)^(关闭|开启)(pixiv|yande|lolicon|local|konachan)\$ " )
133
- content { enableSetu.matcher(message.contentToString()).find() } quoteReply { Helper .enableSetu(this ) }
135
+ content { enableSetu.matcher(message.contentToString()).find() && ! Setting .black.contains(group.id.toString()) } quoteReply { Helper .enableSetu(this ) }
134
136
135
137
val enableSearch = Pattern .compile(" (?i)^(关闭|开启)(ascii2d|google|saucenao|yandex|iqdb)\$ " )
136
- content { enableSearch.matcher(message.contentToString()).find() } quoteReply { Helper .enableSearch(this ) }
138
+ content { enableSearch.matcher(message.contentToString()).find() && ! Setting .black.contains(group.id.toString()) } quoteReply { Helper .enableSearch(this ) }
137
139
138
140
val lowPoly = Pattern .compile(" (?i)^(${Command .lowPoly} ).+\$ " )
139
- content { lowPoly.matcher(message.contentToString()).find() } quoteReply {
141
+ content { lowPoly.matcher(message.contentToString()).find() && ! Setting .black.contains(group.id.toString()) } quoteReply {
140
142
val picUri = DataUtil .getSubString(this .message.toString().replace(" " , " " ), " [mirai:image:{" , " }." )!!
141
143
.replace(" -" , " " )
142
144
val url = " https://gchat.qpic.cn/gchatpic_new/0/0-0-${picUri} /0?"
0 commit comments