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
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// by 癫癫博士
|
2 |
+
// 实现自定义戳一戳交互功能,支持返回文字图片语音禁言,其中语音需配置ffmpeg
|
3 |
+
// 希望大家喜欢^^
|
4 |
+
//本人没有测试群,不过其他大佬有(比如渔火佬仓库里的其他作者),可以去看看,我也在里面快乐水群^^
|
5 |
+
//有idea/有提议/发现bug的话可以通过gitee评论或者私聊联系我~
|
6 |
+
//项目gitee地址:https://gitee.com/huangshx2001/yunzai-js-plug-in
|
7 |
+
//欢迎来找找其他有趣的项目或者来点个star~
|
8 |
+
|
9 |
+
//阿露改动:将语音从接口获取改为本地发送
|
10 |
+
|
11 |
+
|
12 |
+
import plugin from'../../lib/plugins/plugin.js'
|
13 |
+
import{segment}from'oicq'
|
14 |
+
import cfg from'../../lib/config/config.js'
|
15 |
+
import common from'../../lib/common/common.js'
|
16 |
+
const path=process.cwd()
|
17 |
+
|
18 |
+
|
19 |
+
//在这里设置事件概率,请保证概率加起来小于1,少于1的部分会触发反击
|
20 |
+
let reply_text = 0.15 //文字回复概率
|
21 |
+
let reply_img = 0.67 //图片回复概率
|
22 |
+
let reply_voice = 0.00 //语音回复概率
|
23 |
+
let mutepick = 0.02 //禁言概率
|
24 |
+
let example = 0.08 //拍一拍表情概率
|
25 |
+
//剩下的0.08概率就是反击
|
26 |
+
|
27 |
+
|
28 |
+
//定义图片存放路径 默认是Yunzai-Bot/resources/chuochuo
|
29 |
+
const chuo_path=path+'/resources/chuochuo/';
|
30 |
+
|
31 |
+
//定义语音存放路径 默认是Yunzai-Bot/resources/chuochuo2
|
32 |
+
const chuo_path2=path+'/resources/chuochuo2/'
|
33 |
+
|
34 |
+
//图片需要从1开始用数字命名并且保存为jpg或者gif格式,存在Yunzai-Bot/resources/chuochuo目录下
|
35 |
+
let jpg_number = 915 //输入jpg图片数量
|
36 |
+
let gif_number = 2 //输入gif图片数量
|
37 |
+
|
38 |
+
//语音与图片同理,需要将语音从1开始用数字命名并且保存为wav格式,存在Yunzai-Bot/resources/chuochuo2目录下
|
39 |
+
let wav_number = 1 //输入wav音频数量
|
40 |
+
|
41 |
+
|
42 |
+
//回复文字列表
|
43 |
+
let word_list=['戳一次保底一次,嘻嘻',
|
44 |
+
'痛QAQ...',
|
45 |
+
'不要戳戳…',
|
46 |
+
'旅行者,你深渊12层能一次过吗?',
|
47 |
+
'快带我去玩!(打滚)',
|
48 |
+
'哇,你这个人!',
|
49 |
+
'我真的是栓Q',
|
50 |
+
'(◦`~´◦)你个老六',
|
51 |
+
'【保底七七概率+10%】',
|
52 |
+
'【保底天空之卷概率+10%】',
|
53 |
+
'【保底迪卢克概率+10%】',
|
54 |
+
'【保底莫娜概率+10%】',
|
55 |
+
'【保底琴概率+10%】',
|
56 |
+
'【保底刻晴概率+10%】',
|
57 |
+
'【保底风鹰剑概率+10%】',
|
58 |
+
'【保底狼末概率+10%】',
|
59 |
+
'【保底迪卢克概率+10%】',
|
60 |
+
'【保底天空之刃概率+10%】',
|
61 |
+
'【保底提纳里概率+10%】',
|
62 |
+
'【保底阿莫斯之弓概率+10%】',
|
63 |
+
'【保底和璞鸢概率+10%】',
|
64 |
+
'【保底天空之脊概率+10%】',
|
65 |
+
'【保底天空之傲概率+10%】',
|
66 |
+
'【保底天空之翼概率+10%】',
|
67 |
+
'【保底四风原典概率+10%】',
|
68 |
+
'是哪个笨蛋在戳我?',
|
69 |
+
'奖励你一只甜甜花酿鸡',
|
70 |
+
'干点正事吧!',
|
71 |
+
'这破群我是一点也待不下去了!',
|
72 |
+
'可恶!',
|
73 |
+
'囊哒哟~',
|
74 |
+
'达咩!',
|
75 |
+
'呜哇!',
|
76 |
+
'你个坏蛋~',
|
77 |
+
'(摇头)',
|
78 |
+
'(后空翻)',
|
79 |
+
'(劈叉)',
|
80 |
+
'(惊醒)',
|
81 |
+
'(楞)',
|
82 |
+
'(眨眼)',
|
83 |
+
'?',
|
84 |
+
'气气!',
|
85 |
+
'过分分!',
|
86 |
+
'走开啦!',
|
87 |
+
'੭ ᐕ)੭*⁾⁾',
|
88 |
+
'`⌒´メ',
|
89 |
+
'o(´^`)o',
|
90 |
+
'(。’▽’。)♡',
|
91 |
+
'(〟-_・)ン?',
|
92 |
+
'Σ(°Д°;',
|
93 |
+
'⋟﹏⋞',
|
94 |
+
'◦˙▽˙◦',
|
95 |
+
'ξ( ✿>◡❛)',
|
96 |
+
'_(:3 ⌒゙)_',
|
97 |
+
'(╯‵□′)╯︵┴─┴',
|
98 |
+
'呜哇!我要给你起个难听的绰号!',
|
99 |
+
'(宵宫拿走了旅行者仓库里的一把五星武器)',
|
100 |
+
'【强化圣遗物时小防御拉满】',
|
101 |
+
'【强化圣遗物时小生命拉满】',
|
102 |
+
'【强化圣遗物时精通拉满】',
|
103 |
+
'【强化圣遗物时小攻击拉满】',
|
104 |
+
'【强化圣遗物时暴击率拉满】',
|
105 |
+
'【强化圣遗物时暴击伤害拉满】',
|
106 |
+
'吃我一拳!',
|
107 |
+
'饿饿...',
|
108 |
+
'讨厌!',
|
109 |
+
'坏坏!',
|
110 |
+
'哒咩,别戳了!',
|
111 |
+
'呜哇!主人救命!',
|
112 |
+
'你欺负我!',
|
113 |
+
'充电的时候不可以戳啊,万一漏电了怎么办?',
|
114 |
+
'QAQ呜哇啊啊啊啊啊!',
|
115 |
+
'【旅行者命之座-1】',
|
116 |
+
'【旅行者保底次数+1】',
|
117 |
+
'【纠缠之缘-10】',
|
118 |
+
'【空月祝福-30】',
|
119 |
+
'【大冒险家的经验-100】',
|
120 |
+
'【摩拉-300w】',
|
121 |
+
'【原石-1600】',
|
122 |
+
'(宵宫偷偷拿走了你3000w摩拉,买了甜甜花酿鸡)',
|
123 |
+
'(宵宫想要拿走你的原石,但失败了...)',
|
124 |
+
'(宵宫拿走了你背包里10个相遇之缘)',
|
125 |
+
'QAQ..这个人欺负我…',
|
126 |
+
'呜呜,要变笨啦!',
|
127 |
+
'呜呜呜...你还戳QAQ',
|
128 |
+
'再戳哭给你看!',
|
129 |
+
'只给你戳一小会儿~',
|
130 |
+
'虽然戳不坏,但我也是有脾气哒!',
|
131 |
+
'别戳了别戳了><',
|
132 |
+
'QAQ',
|
133 |
+
'你怎么又戳我,气气!',
|
134 |
+
];
|
135 |
+
|
136 |
+
|
137 |
+
export class chuo extends plugin{
|
138 |
+
constructor(){
|
139 |
+
super({
|
140 |
+
name: '戳一戳',
|
141 |
+
dsc: '戳一戳机器人触发效果',
|
142 |
+
event: 'notice.group.poke',
|
143 |
+
priority: 50,
|
144 |
+
rule: [
|
145 |
+
{
|
146 |
+
/** 命令正则匹配 */
|
147 |
+
fnc: 'chuoyichuo'
|
148 |
+
}
|
149 |
+
]
|
150 |
+
}
|
151 |
+
)
|
152 |
+
}
|
153 |
+
|
154 |
+
|
155 |
+
async chuoyichuo (e){
|
156 |
+
logger.info('[戳一戳生效]')
|
157 |
+
if(e.target_id == cfg.qq){
|
158 |
+
//生成0-100的随机数
|
159 |
+
let random_type = Math.random()
|
160 |
+
|
161 |
+
//回复随机文字
|
162 |
+
if(random_type < reply_text){
|
163 |
+
let text_number = Math.ceil(Math.random() * word_list['length'])
|
164 |
+
await e.reply(word_list[text_number-1])
|
165 |
+
}
|
166 |
+
|
167 |
+
|
168 |
+
//回复随机图片
|
169 |
+
else if(random_type < (reply_text + reply_img)){
|
170 |
+
|
171 |
+
let photo_number = Math.ceil(Math.random() * (jpg_number + gif_number))
|
172 |
+
|
173 |
+
if(photo_number<=jpg_number){
|
174 |
+
e.reply(segment.image('file:///' + path + '/resources/chuochuo/'+ photo_number + '.jpg'))
|
175 |
+
}
|
176 |
+
else{
|
177 |
+
photo_number = photo_number - jpg_number
|
178 |
+
e.reply(segment.image('file:///' + path + '/resources/chuochuo/'+ photo_number + '.gif'))
|
179 |
+
}
|
180 |
+
|
181 |
+
}
|
182 |
+
|
183 |
+
//回复随机语音
|
184 |
+
else if(random_type < (reply_text + reply_img + reply_voice)){
|
185 |
+
|
186 |
+
let voice_number = Math.ceil(Math.random() * (wav_number))
|
187 |
+
|
188 |
+
if(voice_number<=wav_number){
|
189 |
+
e.reply(segment.record('file:///' + path + '/resources/chuochuo2/'+ voice_number + '.wav'))
|
190 |
+
}
|
191 |
+
}
|
192 |
+
//禁言
|
193 |
+
else if(random_type < (reply_text + reply_img + reply_voice + mutepick)){
|
194 |
+
//两种禁言方式,随机选一种
|
195 |
+
let mutetype = Math.ceil(Math.random() * 2)
|
196 |
+
if(mutetype == 1){
|
197 |
+
e.reply('说了不要戳了!')
|
198 |
+
await common.sleep(1000)
|
199 |
+
await e.group.muteMember(e.operator_id,60);
|
200 |
+
await common.sleep(3000)
|
201 |
+
e.reply('啧')
|
202 |
+
//有这个路径的图话可以加上
|
203 |
+
//await e.reply(segment.image('file:///' + path + '/resources/chuochuo/'+'laugh.jpg'))
|
204 |
+
}
|
205 |
+
else if (mutetype == 2){
|
206 |
+
e.reply('不!!')
|
207 |
+
await common.sleep(500);
|
208 |
+
e.reply('准!!')
|
209 |
+
await common.sleep(500);
|
210 |
+
e.reply('戳!!')
|
211 |
+
await common.sleep(1000);
|
212 |
+
await e.group.muteMember(e.operator_id,60)
|
213 |
+
}
|
214 |
+
}
|
215 |
+
|
216 |
+
//拍一拍表情包
|
217 |
+
else if(random_type < (reply_text + reply_img + reply_voice + mutepick + example)){
|
218 |
+
await e.reply(await segment.image(`http://ovooa.com/API/face_pat/?QQ=${e.operator_id}`))
|
219 |
+
}
|
220 |
+
|
221 |
+
//反击
|
222 |
+
else {
|
223 |
+
e.reply('反击!')
|
224 |
+
await common.sleep(1000)
|
225 |
+
await e.group.pokeMember(e.operator_id)
|
226 |
+
}
|
227 |
+
|
228 |
+
}
|
229 |
+
|
230 |
+
}
|
231 |
+
|
232 |
+
}
|