没写完的戳一戳功能

This commit is contained in:
Jerry 2025-05-21 18:43:34 +08:00
parent 61372f49d5
commit 6fad06b366
3 changed files with 123 additions and 6 deletions

View File

@ -3,10 +3,11 @@ import tool from '../components/tool.js';
import axios from 'axios';
import configControl from '../lib/config/configControl.js';
const replyText = 0.4;
const replyVoice = 0.2;
const mutePick = 0.1;
const pai = 0.1;
const replyText = configControl.get('poke')?.replyText;
const replyVoice = configControl.get('poke')?.replyVoice;
const mutePick = configControl.get('poke')?.mutePick;
const pai = configControl.get(`poke`)?.pai;
const muteTime = configControl.get('poke')?.muteTime;
export default class pockpock extends plugin {
constructor() {
@ -31,7 +32,7 @@ async function pokeMaster(e) {
if (cfg.masterQQ.includes(e.operator_id) || e.self_id === e.operator_id) {
return;
}
e.reply(`你几把谁啊,敢戳我亲爱的主人,胆子好大啊你🤚😡🤚`);
e.reply(`你几把谁啊,敢戳我主人,胆子好大啊你🤚😡🤚`);
await tool.sleep(1000);
e.bot.sendApi('group_poke', { group_id: this.e.group_id, user_id: e.operator_id });
return true;
@ -52,7 +53,54 @@ async function chuochuo(e) {
if (returnData?.success) {
return await e.reply(returnData.data);
} else {
return await e.reply(`戳一戳出错了!${configControl.get('nickName')}不知道要说啥好了..`);
return await e.reply(`戳一戳出错了!${configControl.get('nickName')}不知道该说啥好了..`);
}
} else if (randomNum < replyText + replyVoice) {
const returnData = await axios.get(
`${configControl.get(`coreConfig`)?.coreUrl}/api/words/getText/poke`
);
if (returnData?.success) {
let message = returnData?.data;
message = cleanText(message);
return;
//await this.e.bot.sendApi('') // TODO 🐎呀忘了api是啥了
} else {
return await e.reply(`戳一戳出错了!${configControl.get('nickName')}不知道该说啥好了..`);
}
} else if (randomNum < replyText + replyVoice + mutePick) {
// TODO 判断是否管理
let mutetype = Math.ceil(Math.random() * 4);
if (mutetype === 1) {
e.reply('我生气了!砸挖撸多!木大!木大木大!');
await tool.sleep(1000);
await e.group.muteMember(e.operator_id, 60 * muteTime);
}
if (mutetype === 2) {
e.reply('不!!');
await tool.sleep(1000);
e.reply('准!!');
await tool.sleep(1000);
e.reply('戳!!');
await tool.sleep(1000);
await e.group.muteMember(e.operator_id, 60 * muteTime);
await tool.sleep(1000);
e.reply('');
return;
}
if (mutetype === 3) {
e.reply('吃我10068拳');
await tool.sleep(1000);
e.bot.sendApi('group_poke', { group_id: this.e.group_id, user_id: e.operator_id });
await e.group.muteMember(e.operator_id, 60 * muteTime);
await tool.sleep(1000);
return;
}
if (mutetype === 4) {
e.reply('哼,我可是会还手的哦——');
await tool.sleep(1000);
e.bot.sendApi('group_poke', { group_id: this.e.group_id, user_id: e.operator_id });
await e.group.muteMember(e.operator_id, 60 * muteTime);
return;
}
}
}

62
config/config.md Normal file
View File

@ -0,0 +1,62 @@
### 参考以下注释进行配置,不要带注释粘贴,也不要改动`default.json`
配置文件位于`yunzai`根目录`/data/crystelf下`
参考注释:
``` yaml
{
"debug": true,\\是否启用调试模式
"core": true,\\是否启用晶灵核心相关功能
"coreConfig": { //晶灵核心配置
"coreUrl": "", //核心网址需要加https://前缀
"wsUrl": "", //ws连接地址如ws://
"wsClientId": "",//端id
"wsSecret": "", wsmiy
"wsReConnectInterval": "5000",
"token": ""//postAPI调用密钥
},
"maxFeed": 10,//最大缓存rss流
"feeds": [//rss相关配置无需手动更改
{
"url": "",
"targetGroups": [114,154],
"screenshot": true
}
],
"fanqieConfig": {//番茄小说功能
"url": "http://127.0.0.1:6868",
"outDir": "/home/user/debian/cache/Downloads"
},
"poke": {//戳一戳概率加起来不超过1余下的概率为反击概率
"replyText": 0.4,
"replyVoice": 0.2,
"mutePick": 0.1,
"pai": 0.1,
""muteTime": 2"
},
"mode": "deepseek",//deepseekORopenai
"modelType": "deepseek-ai/DeepSeek-V3",//无需更改
"historyLength": 3,
"maxLength": 3,
"chatTemperature": 1,
"pluginTemperature": 0.5,
"nickName": "寄气人",//昵称
"checkChat": {
"rdNum": 2,//随机数0-100
"masterReply": true,//主人回复
"userId": [ //一定回复的人
114514
],
"blackGroups": [//不许使用的群聊
114,
514
],
"enableGroups": [//一定回复的群聊
11115
]
},
"maxMessageLength": 100//最大上下文
}
```

View File

@ -17,6 +17,13 @@
"screenshot": true
}
],
"poke": {
"replyText": 0.4,
"replyVoice": 0.2,
"mutePick": 0.1,
"pai": 0.1,
"muteTime": 2
},
"fanqieConfig": {
"url": "http://127.0.0.1:6868",
"outDir": "/home/user/debian/cache/Downloads"