mirror of
https://github.com/Jerryplusy/crystelf-plugin.git
synced 2025-07-04 14:19:19 +00:00
没写完的戳一戳功能
This commit is contained in:
parent
f93261bfb2
commit
61372f49d5
@ -6,7 +6,7 @@ import Fanqie from '../models/apps/fanqie/fanqie.js';
|
||||
|
||||
let redis = global.redis;
|
||||
|
||||
export class xzq extends plugin {
|
||||
export default class xzq extends plugin {
|
||||
constructor() {
|
||||
super({
|
||||
name: 'fanqie',
|
||||
@ -163,7 +163,7 @@ export class xzq extends plugin {
|
||||
if (!e.isMaster) {
|
||||
const allowGroup = e.isGroup ? await redis.get(`fqxzq:g:${e.group_id}`) : null;
|
||||
const allowUser = await redis.get(`fqxzq:u:${e.user_id}`);
|
||||
return e.reply(`暂未开放下载功能,请等待功能更新..`);
|
||||
return e.reply(`暂未开放下载功能,请等待功能更新..`, true);
|
||||
//if (!allowGroup && !allowUser) return false;
|
||||
}
|
||||
|
||||
|
63
apps/poke.js
Normal file
63
apps/poke.js
Normal file
@ -0,0 +1,63 @@
|
||||
import cfg from '../../../lib/config/config.js';
|
||||
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;
|
||||
|
||||
export default class pockpock extends plugin {
|
||||
constructor() {
|
||||
super({
|
||||
name: '戳一戳',
|
||||
dsc: '喜欢戳鸡气人',
|
||||
event: 'notice.group.poke',
|
||||
priority: -114510,
|
||||
rule: [
|
||||
{
|
||||
fnc: '11111',
|
||||
},
|
||||
],
|
||||
});
|
||||
}
|
||||
|
||||
async chuoyichuo(e) {}
|
||||
}
|
||||
|
||||
async function pokeMaster(e) {
|
||||
logger.info('谁戳主人了..');
|
||||
if (cfg.masterQQ.includes(e.operator_id) || e.self_id === e.operator_id) {
|
||||
return;
|
||||
}
|
||||
e.reply(`你几把谁啊,敢戳我亲爱的主人,胆子好大啊你🤚😡🤚`);
|
||||
await tool.sleep(1000);
|
||||
e.bot.sendApi('group_poke', { group_id: this.e.group_id, user_id: e.operator_id });
|
||||
return true;
|
||||
}
|
||||
|
||||
async function masterPoke(e) {
|
||||
logger.info(`跟主人一起戳!`);
|
||||
e.bot.sendApi('group_poke', { group_id: this.e.group_id, user_id: e.target_id });
|
||||
return true;
|
||||
}
|
||||
|
||||
async function chuochuo(e) {
|
||||
const randomNum = Math.random();
|
||||
if (randomNum < replyText) {
|
||||
const returnData = await axios.get(
|
||||
`${configControl.get(`coreConfig`)?.coreUrl}/api/words/getText/poke`
|
||||
);
|
||||
if (returnData?.success) {
|
||||
return await e.reply(returnData.data);
|
||||
} else {
|
||||
return await e.reply(`戳一戳出错了!${configControl.get('nickName')}不知道要说啥好了..`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function cleanText(inputText) {
|
||||
//保留逗号、句号、感叹号、问号,及字母和数字
|
||||
return inputText.replace(/[^\w\s,.!?]/g, '');
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user