代码拉取完成,页面将自动刷新
import plugin from '../../lib/plugins/plugin.js'
import fs from 'fs'
import schedule from 'node-schedule'
import path from "path";
import lodash from 'lodash'
import common from "../../lib/common/common.js";
let ks = 0
let kb = 0
let uid = 0
let dsq2 = ""
let b = ""
let cainum = ""
let cdtime = 120; //透cd时间,单位秒
let dacdtime = 300; //打胶cd时间,单位秒
let pkcdtime = 300; //对决cd时间,单位秒
let cooldowns = new Map();
let dadowns = new Map();
let pkdowns = new Map();
let fukpath = 'resources/fuck';
if (!fs.existsSync(fukpath)) {
fs.mkdirSync(fukpath);
}
let jjpath = 'resources/fuck/jj';
if (!fs.existsSync(jjpath)) {
fs.mkdirSync(jjpath);
}
let toupath = 'resources/fuck/tou';
if (!fs.existsSync(toupath)) {
fs.mkdirSync(toupath);
}
export class fuck extends plugin {
constructor () {
super({
name: '日群友',
dsc: '随机给一位群友注射脱氧核糖核酸',
event: 'message',
priority: 5000,
rule: [
{
reg: '^#?(透|草|日)群友$',
fnc: 'fuck'
},
{
reg: '^#?(透|草|日)群主$',
fnc: 'fuckowner'
},
{
reg: '^#?(透|草|日)管理$',
fnc: 'fuckadmin'
},
{
reg: '^#?(pk|PK|对决)$',
fnc: 'jjpk'
},
{
reg: '^#?摇骰子$|我来摇$',
fnc: 'jjcai'
},
{
reg: '^#?(打胶|锻炼|嗦牛子|嗦牛牛)$',
fnc: 'dajiao'
},
{
reg: '^#?(被透查询|注射量查询)$',
fnc: 'toucha'
},
{
reg: '^#?(牛牛|牛子)(长度|查询)$',
fnc: 'jjcha'
},
{
reg: '^#?被透(榜|排行|排行榜|排名)$',
fnc: 'toubang'
},
{
reg: '^#?(牛子|牛牛)(榜|排行|排行榜|排名)$',
fnc: 'jjbang'
},
{
reg: '^#剁掉$',
fnc: 'duodiao'
},
{
reg: '^#开启银趴$|#关闭银趴$',
fnc: 'fuckset'
},
{
reg: '^#?银趴帮助$',
fnc: 'jjhelp'
},
]
})
}
async jjhelp(e) {
let mhelp = [
`银趴群小游戏使用说明:\n`,
`主人指令:#开启银趴 #关闭银趴\n`,
`通用指令:\n`,
`透群友(可以@xx) 透群主 透管理\n`,
`打胶|锻炼|嗦牛子(可以@xx) PK|对决(@xx) 摇骰子\n`,
`被透查询|牛子查询(可以@xx) 被透排行 牛子排行\n`,
`#剁掉`
]
e.reply(mhelp)
return true;
}
async fuckset(e) {
if (!e.isGroup || !e.isMaster) {
e.reply('你不是主人没有权限哦~')
return;
}
let groupId = e.group_id; // 获取群聊号
let qxpat = `resources/fuck/${groupId}.txt`;
if (e.msg.includes("#开启银趴")) {
fs.writeFileSync(qxpat,`1`)
e.reply(`${groupId}已开启银趴`)
}
if (e.msg.includes("#关闭银趴")) {
fs.writeFileSync(qxpat,`0`)
e.reply(`${groupId}已关闭银趴`)
}
}
async fuck (e) {
if (!e.isGroup) {
e.reply("只能在群聊使用呢~");
return;
}
let groupId = e.group_id; // 获取群聊号
let dem = `resources/fuck/${groupId}.txt`
if (!fs.existsSync(dem)) {
fs.writeFileSync(dem,`0`);
console.log(`${groupId}权限文件不存在自动创建 0`)
}
let qx = fs.readFileSync(dem)
console.log(`${groupId}权限为${qx}`)
if (qx == 0 && !e.isMaster ) {
e.reply(`${groupId}还未开启银趴!`);
return;
}
if (!e.isMaster ) {
const userId = e.user_id;
const cooldown = cooldowns[userId];
if (cooldown && cooldown > Date.now()) {
const remainingTime = Math.ceil((cooldown - Date.now()) / 1000);
e.reply(`你已经榨不出来任何东西了, 请先休息 ${remainingTime} 秒~`);
return;
}
cooldowns[userId] = Date.now() + cdtime * 1000;
}
console.log("用户命令:", e.msg);
if(e.message[1]){
if (e.message[1].type == 'at') {
let user_id2 = e.at;
let name = e.message[1].text.replace("@","")
if (user_id2 == e.user_id) {
e.reply(`哎呀!你要艹你自己?办不到,怎么想都办不到吧!`);
return;
}
let ab = [`现在咱将把 ${name} 送给 ${e.nickname} 色色!`];
e.reply(ab);
await sleep(5000);
let num = Math.round(Math.random() * 100);
if (num <= 10) {
let msg = [`哎呀~${e.nickname} 让亲狗的爱群友 ${name} 跑掉了呢~下次再试试吧~`]
e.reply(msg);
} else if (num <= 20) {
let msg = [`哎呀!${e.nickname} 逮到了亲狗的爱群友 ${name} 结果给艹歪了,只因不行,好可惜呢~`]
e.reply(msg);
} else if (num > 20) {
let ztime = (Math.random() * 60).toFixed(2);
let znum = (Math.random() * 50).toFixed(2);
let zrgp = `resources/fuck/tou/${e.group_id}`;
if (!fs.existsSync(zrgp)) {
fs.mkdirSync(zrgp);
}
let zr = `resources/fuck/tou/${e.group_id}/${user_id2}.txt`;
if (!fs.existsSync(zr)) {
fs.writeFileSync(zr,`0`);
console.log(`${user_id2}数据文件不存在自动创建`)
}
let lszr = +fs.readFileSync(zr);
let dqzr = (lszr + +znum).toFixed(2);
await fs.writeFileSync(zr, dqzr);
let msg = [`好欸!${e.nickname} 用时 ${ztime}秒,成功给亲狗的爱群友 ${name} 注射了 ${znum}毫升 的脱氧核糖核酸~今日被注射总量:${dqzr}毫升`, segment.image(`https://q1.qlogo.cn/g?b=qq&s=0&nk=${user_id2}`)]
e.reply(msg);
}
}
}else {
let ab = [`现在咱将随机抽取一位幸运裙友送给 ${e.nickname} 色色!`];
e.reply(ab);
await sleep(5000);
let map = await e.group.getMemberMap();
let arrMember = Array.from(map.values());
let mem = arrMember[Math.round(Math.random() * (arrMember.length-1))];
let num = Math.round(Math.random() * 100);
if (mem.user_id == e.user_id) {
e.reply(`哎呀!你要艹你自己?办不到,怎么想都办不到吧!`);
return;
}
if (num <= 10) {
let msg = [`哎呀~${e.nickname} 让亲狗的爱群友 ${mem.nickname} 跑掉了呢~下次再试试吧~`]
e.reply(msg);
} else if (num <= 20) {
let msg = [`哎呀!${e.nickname} 成功逮到了亲狗的爱群友 ${mem.nickname} 结果给艹歪了,只因不行,好可惜呢~`]
e.reply(msg);
} else if (num > 20) {
let ztime = (Math.random() * 60).toFixed(2);
let znum = (Math.random() * 50).toFixed(2);
let zrgp = `resources/fuck/tou/${e.group_id}`;
if (!fs.existsSync(zrgp)) {
fs.mkdirSync(zrgp);
}
let zr = `resources/fuck/tou/${e.group_id}/${mem.user_id}.txt`;
if (!fs.existsSync(zr)) {
fs.writeFileSync(zr,`0`);
console.log(`${mem.user_id}数据文件不存在自动创建`)
}
let lszr = +fs.readFileSync(zr);
let dqzr = (lszr + +znum).toFixed(2);
await fs.writeFileSync(zr, dqzr);
let msg = [`好欸!`,segment.at(e.user_id),` 用时 ${ztime}秒,成功给亲狗的爱群友 ${mem.nickname} 注射了 ${znum}毫升 的脱氧核糖核酸~今日被注射总量:${dqzr}毫升`, segment.image(`https://q1.qlogo.cn/g?b=qq&s=0&nk=${mem.user_id}`)]
e.reply(msg);
}
}
}
async fuckowner (e) {
if (!e.isGroup) {
e.reply("只能在群聊使用呢~");
return;
}
let groupId = e.group_id; // 获取群聊号
let dem = `resources/fuck/${groupId}.txt`
if (!fs.existsSync(dem)) {
fs.writeFileSync(dem,`0`);
console.log(`${groupId}权限文件不存在自动创建 0`)
}
let qx = fs.readFileSync(dem)
console.log(`${groupId}权限为${qx}`)
if (qx == 0 && !e.isMaster ) {
e.reply(`${groupId}还未开启银趴!`);
return;
}
if (!e.isMaster ) {
const userId = e.user_id;
const cooldown = cooldowns[userId];
if (cooldown && cooldown > Date.now()) {
const remainingTime = Math.ceil((cooldown - Date.now()) / 1000);
e.reply(`你已经榨不出来任何东西了, 请先休息 ${remainingTime} 秒~`);
return;
}
cooldowns[userId] = Date.now() + cdtime * 1000;
}
console.log("用户命令:", e.msg);
let map = await e.group.getMemberMap();
let arrMember = Array.from(map.values());
if (e.group.pickMember(e.user_id).is_owner) {
let msg = [segment.at(e.user_id),"尊狗的贵群主,你要艹你自己?" ]
e.reply(msg)
} else {
let mem = arrMember[Math.round(Math.random() * (arrMember.length-1))];
while (true) {
if (e.group.pickMember(mem.user_id).is_owner) {
let ab = [`现在咱将把群主 ${mem.nickname} 送给 ${e.nickname} 色色!`];
e.reply(ab);
await sleep(5000);
let num = Math.round(Math.random() * 100);
if (num <= 10) {
let msg = [`哎呀~${e.nickname} 让尊狗的贵群主 ${mem.nickname} 跑掉了呢~下次再试试吧~`]
e.reply(msg);
} else if (num <= 20) {
let msg = [`哎呀!${e.nickname} 成功逮到了尊狗的贵群主 ${mem.nickname} 结果给艹歪了,只因不行,好可惜呢~`]
e.reply(msg);
} else if (num > 20) {
let ztime = (Math.random() * 60).toFixed(2);
let znum = (Math.random() * 50).toFixed(2);
let zrgp = `resources/fuck/tou/${e.group_id}`;
if (!fs.existsSync(zrgp)) {
fs.mkdirSync(zrgp);
}
let zr = `resources/fuck/tou/${e.group_id}/${mem.user_id}.txt`;
if (!fs.existsSync(zr)) {
fs.writeFileSync(zr,`0`);
console.log(`${mem.user_id}数据文件不存在自动创建`)
}
let lszr = +fs.readFileSync(zr);
let dqzr = (lszr + +znum).toFixed(2);
await fs.writeFileSync(zr, dqzr);
let msg = [`好欸!${e.nickname} 用时 ${ztime}秒,成功给尊狗的贵群主 ${mem.nickname} 注射了 ${znum}毫升 的脱氧核糖核酸~今日被注射总量:${dqzr}毫升`, segment.image(`http://q1.qlogo.cn/g?b=qq&nk=${mem.user_id}&s=640`)]
e.reply(msg);
}
break
} else {
mem = arrMember[Math.round(Math.random() * (arrMember.length-1))];
}
}
}
}
async fuckadmin (e) {
if (!e.isGroup) {
e.reply("只能在群聊使用呢~");
return;
}
let groupId = e.group_id; // 获取群聊号
let dem = `resources/fuck/${groupId}.txt`
if (!fs.existsSync(dem)) {
fs.writeFileSync(dem,`0`);
console.log(`${groupId}权限文件不存在自动创建 0`)
}
let qx = fs.readFileSync(dem)
console.log(`${groupId}权限为${qx}`)
if (qx == 0 && !e.isMaster ) {
e.reply(`${groupId}还未开启银趴!`);
return;
}
if (!e.isMaster ) {
const userId = e.user_id;
const cooldown = cooldowns[userId];
if (cooldown && cooldown > Date.now()) {
const remainingTime = Math.ceil((cooldown - Date.now()) / 1000);
e.reply(`你已经榨不出来任何东西了, 请先休息 ${remainingTime} 秒~`);
return;
}
cooldowns[userId] = Date.now() + cdtime * 1000;
}
console.log("用户命令:", e.msg);
let map = await e.group.getMemberMap();
let arrMember = Array.from(map.values());
let mem = arrMember[Math.round(Math.random() * (arrMember.length-1))];
while (true) {
if (e.group.pickMember(mem.user_id).is_admin) {
if (e.group.pickMember(mem.user_id).is_admin && mem.user_id == e.user_id) {
let msg = [ segment.at(e.user_id),"亲狗的爱管理,你要艹你自己?"]
e.reply(msg);
return;
}
let ab = [`现在咱将把管理 ${mem.nickname} 送给 ${e.nickname} 色色!`];
e.reply(ab);
await sleep(5000);
let num = Math.round(Math.random() * 100);
if (num <= 10) {
let msg = [`哎呀~${e.nickname} 让亲狗的爱管理 ${mem.nickname} 跑掉了呢~下次再试试吧~`]
e.reply(msg);
} else if (num <= 20) {
let msg = [`哎呀!${e.nickname} 成功逮到了亲狗的爱管理 ${mem.nickname} 结果给艹歪了,只因不行,好可惜呢~`]
e.reply(msg);
} else if (num > 20) {
let ztime = (Math.random() * 60).toFixed(2);
let znum = (Math.random() * 50).toFixed(2);
let zrgp = `resources/fuck/tou/${e.group_id}`;
if (!fs.existsSync(zrgp)) {
fs.mkdirSync(zrgp);
}
let zr = `resources/fuck/tou/${e.group_id}/${mem.user_id}.txt`;
if (!fs.existsSync(zr)) {
fs.writeFileSync(zr,`0`);
console.log(`${mem.user_id}数据文件不存在自动创建`)
}
let lszr = +fs.readFileSync(zr);
let dqzr = (lszr + +znum).toFixed(2);
await fs.writeFileSync(zr, dqzr);
let msg = [`好欸!${e.nickname} 用时 ${ztime}秒,成功给亲狗的爱管理 ${mem.nickname} 注射了 ${znum}毫升 的脱氧核糖核酸~今日被注射总量:${dqzr}毫升`, segment.image(`https://q1.qlogo.cn/g?b=qq&s=0&nk=${mem.user_id}`)]
e.reply(msg);
}
break
} else {
mem = arrMember[Math.round(Math.random() * (arrMember.length-1))];
}
}
}
async dajiao (e) {
if (!e.isGroup) {
e.reply("只能在群聊使用呢~");
return;
}
let groupId = e.group_id; // 获取群聊号
let dem = `resources/fuck/${groupId}.txt`
if (!fs.existsSync(dem)) {
fs.writeFileSync(dem,`0`);
console.log(`${groupId}权限文件不存在自动创建 0`)
}
let qx = fs.readFileSync(dem)
console.log(`${groupId}权限为${qx}`)
if (qx == 0 && !e.isMaster ) {
e.reply(`${groupId}还未开启银趴!`);
return;
}
if (!e.isMaster ) {
const userId = e.user_id;
const dadown = dadowns[userId];
if (dadown && dadown > Date.now()) {
const remainingTime = Math.ceil((dadown - Date.now()) / 1000);
e.reply(`运动太频繁了捏, 请先休息 ${remainingTime} 秒~`);
return;
}
dadowns[userId] = Date.now() + dacdtime * 1000;
}
console.log("用户命令:", e.msg);
if(e.message[1]){
if (e.message[1].type == 'at') {
kb = 1
let user_id2 = e.at;
let name = e.message[1].text.replace("@","")
let djgp = `resources/fuck/jj/${e.group_id}`;
if (!fs.existsSync(djgp)) {
fs.mkdirSync(djgp);
}
let djjj = `resources/fuck/jj/${e.group_id}/${user_id2}.txt`;
if (!fs.existsSync(djjj)) {
fs.writeFileSync(djjj,`10`);
let msg1 = [`${name} 牛子不存在自动创建了喵~当前长度为 10 厘米~`];
e.reply(msg1);
await sleep(2000);
}
await sleep(3000);
let djnum = (Math.random() * 2).toFixed(2);
let djtime = (Math.random() * 60).toFixed(2);
let key = Math.random() * 10;
console.log(key);
if (key <= 5) {
let lsdj = +fs.readFileSync(djjj);
let dqdj = (lsdj + +djnum).toFixed(2);
await fs.writeFileSync(djjj,dqdj );
let msg3 = [`恭喜 ${e.nickname} 成功给 ${name} 的牛子做完了运动,使其增加了 ${djnum} 厘米,当前长度为 ${dqdj} 厘米喵~`]
e.reply(msg3);
}
} else if (key > 5) {
let lsdj = +fs.readFileSync(djjj);
let dqdj = (lsdj - +djnum).toFixed(2);
await fs.writeFileSync(djjj,dqdj );
let msg3 = [`好可惜呢,${e.nickname} 给 ${name} 的牛子做运动失败了喵,牛子受到刺激缩短了 ${djnum} 厘米,当前长度为 ${dqdj} 厘米喵~`]
e.reply(msg3);
}
}else{
let djgp = `resources/fuck/jj/${e.group_id}`;
if (!fs.existsSync(djgp)) {
fs.mkdirSync(djgp);
}
let djjj = `resources/fuck/jj/${e.group_id}/${e.user_id}.txt`;
if (!fs.existsSync(djjj)) {
fs.writeFileSync(djjj,`10`);
let msg1 = [`${e.nickname} 牛子不存在自动创建了喵~当前长度为 10 厘米~`];
e.reply(msg1);
await sleep(2000);
}
await sleep(3000);
let djnum = (Math.random() * 2).toFixed(2);
let djtime = (Math.random() * 60).toFixed(2);
let key = Math.random() * 10;
console.log(key);
if (key <= 7) {
let lsdj = +fs.readFileSync(djjj);
let dqdj = (lsdj + +djnum).toFixed(2);
await fs.writeFileSync(djjj,dqdj );
let msg3 = [`恭喜 ${e.nickname} 成功给牛子做完了运动,使其增加了 ${djnum} 厘米,当前长度为 ${dqdj} 厘米喵~`]
e.reply(msg3);
} else if (key > 7) {
let lsdj = +fs.readFileSync(djjj);
let dqdj = (lsdj - +djnum).toFixed(2);
await fs.writeFileSync(djjj,dqdj );
let msg3 = [`好可惜呢,${e.nickname} 给牛子做运动失败了喵,牛子受到刺激缩短了 ${djnum} 厘米,当前长度为 ${dqdj} 厘米喵~`]
e.reply(msg3);
}
}
}
async jjpk(e) {
if (!e.isGroup) {
e.reply("只能在群聊使用呢~");
return;
}
let groupId = e.group_id; // 获取群聊号
let dem = `resources/fuck/${groupId}.txt`
if (!fs.existsSync(dem)) {
fs.writeFileSync(dem,`0`);
console.log(`${groupId}权限文件不存在自动创建 0`)
}
let qx = fs.readFileSync(dem)
console.log(`${groupId}权限为${qx}`)
if (qx == 0 && !e.isMaster ) {
e.reply(`${groupId}还未开启银趴!`);
return;
}
if (!e.isMaster ) {
const userId = e.user_id;
const pkdown = pkdowns[userId];
if (pkdown && pkdown > Date.now()) {
const remainingTime = Math.ceil((pkdown - Date.now()) / 1000);
let fmsg = [
segment.at(e.user_id),
`你的牛子还没有恢复士气捏, 请先休息 ${remainingTime} 秒~`
];
e.reply(fmsg)
return;
}
pkdowns[userId] = Date.now() + pkcdtime * 1000;
}
console.log("用户命令:", e.msg);
if(e.message[1]){
if (e.message[1].type == 'at') {
let user_id2 = e.at;
if (e.user_id == e.at) {
e.reply(`你一个人怎么进行pk嘛!哎哟~`)
return;
}
let name = e.message[1].text.replace("@","")
let djgp = `resources/fuck/jj/${e.group_id}`;
if (!fs.existsSync(djgp)) {
fs.mkdirSync(djgp);
}
let djjj = `resources/fuck/jj/${e.group_id}/${user_id2}.txt`;
let adjjj = `resources/fuck/jj/${e.group_id}/${e.user_id}.txt`;
if (!fs.existsSync(djjj)) {
fs.writeFileSync(djjj,`10`);
let msg1 = [`${name} 牛子不存在自动创建了喵~当前长度为 10 厘米~`];
e.reply(msg1);
await sleep(2000);
}
if (!fs.existsSync(adjjj)) {
fs.writeFileSync(adjjj,`10`);
let msg5 = [`${e.nickname} 牛子不存在自动创建了喵~当前长度为 10 厘米~`];
e.reply(msg5);
await sleep(2000);
}
if (adjjj < 0) {
let msgg = [
segment.at(e.user_id),
`你的牛子长度不够,无法进行pk!`
]
e.reply(msgg)
return;
}
if (djjj < 0) {
let msgj = [
segment.at(e.user_id),
`你的对手牛子长度不够,无法进行pk!`
]
e.reply(msgj)
return;
}
let msg2 = [`${e.nickname} 对 ${name} 发起了pk,让咱等等喵~`];
let img = [segment.image(`https://api.andeer.top/API/gif_beat_j.php?bqq=${e.user_id}&cqq=${user_id2}`)]
e.reply(msg2);
await e.reply(img)
await sleep(5000);
let djnum = (Math.random() * 2).toFixed(2);
let djtime = (Math.random() * 60).toFixed(2);
let key = Math.random() * 10;
console.log(key);
if (key < 5) {
let lsdj = +fs.readFileSync(djjj);
let alsdj = +fs.readFileSync(adjjj);
let dqdj = (lsdj + +djnum).toFixed(2);
let adqdj = (alsdj - +djnum).toFixed(2);
await fs.writeFileSync(djjj,dqdj );
await fs.writeFileSync(adjjj,adqdj );
let msg3 = [`恭喜 ${name} 在本次pk中大获全胜喵~本次掉落物品牛子${djnum}cm。\n战利品结算:\n${e.nickname}:${alsdj}cm⤵${adqdj}cm\n${name}:${lsdj}cm⤴${dqdj}cm `]
e.reply(msg3);
} else if (key == 5) {
let msg3 = [`${e.nickname} 和 ${name} 本次打成了平手喵~`]
e.reply(msg3);
}else if (key > 5) {
let lsdj = +fs.readFileSync(djjj);
let alsdj = +fs.readFileSync(adjjj);
let dqdj = (lsdj - +djnum).toFixed(2);
let adqdj = (alsdj + +djnum).toFixed(2);
await fs.writeFileSync(djjj,dqdj );
await fs.writeFileSync(adjjj,adqdj );
let msg3 = [`恭喜 ${e.nickname} 在本次pk中大获全胜喵~本次掉落物品牛子${djnum}cm。\n战利品结算:\n${e.nickname}:${alsdj}cm⤴${adqdj}cm\n${name}:${lsdj}cm⤵${dqdj}cm `]
e.reply(msg3);
}
}
}
}
async jjcai(e) {
if (!e.isGroup) {
e.reply("只能在群聊使用呢~");
return;
}
let groupId = e.group_id; // 获取群聊号
let dem = `resources/fuck/${groupId}.txt`
if (!fs.existsSync(dem)) {
fs.writeFileSync(dem,`0`);
console.log(`${groupId}权限文件不存在自动创建 0`)
}
let qx = fs.readFileSync(dem)
console.log(`${groupId}权限为${qx}`)
if (qx == 0 && !e.isMaster ) {
e.reply(`${groupId}还未开启银趴!`);
return;
}
if (!e.isMaster && ks == 0 ) {
const userId = e.user_id;
const cooldown = cooldowns[userId];
if (cooldown && cooldown > Date.now()) {
const remainingTime = Math.ceil((cooldown - Date.now()) / 1000);
e.reply(`你已经榨不出来任何东西了, 请先休息 ${remainingTime} 秒~`);
return;
}
cooldowns[userId] = Date.now() + pkcdtime * 1000;
}
console.log("用户命令:", e.msg);
let djgp = `resources/fuck/jj/${e.group_id}`;
if (!fs.existsSync(djgp)) {
fs.mkdirSync(djgp);
}
let djjj = `resources/fuck/jj/${e.group_id}/${e.user_id}.txt`;
if (!fs.existsSync(djjj)) {
fs.writeFileSync(djjj, `10`);
let msg1 = [`${e.nickname} 牛子不存在自动创建了喵~当前长度为 10 厘米~`];
e.reply(msg1);
await sleep(2000);
}
if (e.msg == "摇骰子" && ks == 1) {
e.reply('我正在和别人玩呢,没空,你先等会。')
return
}
if (e.msg == "摇骰子" || e.msg == "#摇骰子" && ks == 0) {
b = Math.floor(Math.random() * 6) + 1;
cainum = (Math.random() * 2).toFixed(2);
let abc = [
segment.at(e.user_id),
`我摇出了${b},这次赌注是牛子${cainum}厘米。给你30秒,发送“我来摇”摇出你的点数吧`
]
e.reply(abc)
ks = 1
uid = e.user_id
dsq2 = setTimeout(function () {
if (ks == 1) {
let lsdj = +fs.readFileSync(djjj);
let dqdj = (lsdj - +cainum).toFixed(2);
fs.writeFileSync(djjj, dqdj);
e.reply(`30秒还不摇,给我寄\n惩罚结算:\n${e.nickname}:${lsdj}cm⤵${dqdj}cm`)
ks = 0
}
}, 20000);
}
if (e.msg == "我来摇" || e.msg == "#我来摇" && ks == 1 && uid == e.user_id) {
let a = Math.floor(Math.random() * 6) + 1;
if (a > b) {
let lsdj = +fs.readFileSync(djjj);
let dqdj = (lsdj + +cainum).toFixed(2);
await sleep(1000);
let msga = [
`可恶啊,你摇出了${a},你的数字比我大,这次你赢了!\n`,
`战利品结算:\n${e.nickname}:${lsdj}cm⤴${dqdj}cm`
];
fs.writeFileSync(djjj, dqdj);
await e.reply(msga);
ks = 0
}
else if (a < b) {
let lsdj = +fs.readFileSync(djjj);
let dqdj = (lsdj - +cainum).toFixed(2);
await sleep(1000);
let msgb = [
`哈哈,你摇出了${a},我的数字比你的大,这次我赢了!\n`,
`惩罚结算:\n${e.nickname}:${lsdj}cm⤵${dqdj}cm`
];
fs.writeFileSync(djjj, dqdj);
await e.reply(msgb);
ks = 0
}
}
}
async toucha(e) {
if (!e.isGroup) {
e.reply("只能在群聊使用呢~");
return;
}
let groupId = e.group_id; // 获取群聊号
let dem = `resources/fuck/${groupId}.txt`
if (!fs.existsSync(dem)) {
fs.writeFileSync(dem,`0`);
console.log(`${groupId}权限文件不存在自动创建 0`)
}
let qx = fs.readFileSync(dem)
console.log(`${groupId}权限为${qx}`)
if (qx == 0 && !e.isMaster ) {
e.reply(`${groupId}还未开启银趴!`);
return;
}
console.log("用户命令:", e.msg);
if(e.message[1]){
if (e.message[1].type == 'at') {
let uid = e.at;
let name = e.message[1].text.replace("@","")
let zr = `resources/fuck/tou/${e.group_id}/${uid}.txt`;
if (!fs.existsSync(zr)) {
let msg1 = [`${name} 今天还没有被透过!`]
e.reply(msg1)
return;
}
let lsdj = +fs.readFileSync(zr);
let msg2 = [`${name} 今天总共被注射了 ${lsdj} 毫升的脱氧核糖核酸喵~`]
e.reply(msg2);
}
} else {
let uid = e.user_id;
let zr = `resources/fuck/tou/${e.group_id}/${e.nickname}#${uid}.txt`;
if (!fs.existsSync(zr) ) {
let msg1 = [segment.at(uid),` 你今天还没有被透过!`]
e.reply(msg1)
return;
}
let lsdj = +fs.readFileSync(zr);
let msg2 = [segment.at(uid),` 你今天总共被注射了 ${lsdj} 毫升的脱氧核糖核酸喵~`]
e.reply(msg2);
}
}
async jjcha(e) {
if (!e.isGroup) {
e.reply("只能在群聊使用呢~");
return;
}
let groupId = e.group_id; // 获取群聊号
let dem = `resources/fuck/${groupId}.txt`
if (!fs.existsSync(dem)) {
fs.writeFileSync(dem,`0`);
console.log(`${groupId}权限文件不存在自动创建 0`)
}
let qx = fs.readFileSync(dem)
console.log(`${groupId}权限为${qx}`)
if (qx == 0 && !e.isMaster ) {
e.reply(`${groupId}还未开启银趴!`);
return;
}
console.log("用户命令:", e.msg);
if(e.message[1]){
if (e.message[1].type == 'at') {
let uid = e.at;
let name = e.message[1].text.replace("@","")
let zr = `resources/fuck/jj/${e.group_id}/${uid}.txt`;
if (!fs.existsSync(zr)) {
let msg1 = [`${name} 还没有牛子!`]
e.reply(msg1)
return;
}
let lsjj = +fs.readFileSync(zr);
let msg2 = [`${name} 的牛子当前长度为 ${lsjj} 厘米喵~`]
e.reply(msg2);
}
} else {
let uid = e.user_id;
let zr = `resources/fuck/jj/${e.group_id}/${uid}.txt`;
if (!fs.existsSync(zr)) {
let msg1 = [segment.at(uid),` 你还没有牛子!`]
e.reply(msg1)
return;
}
let lsjj = +fs.readFileSync(zr);
let msg2 = [segment.at(uid),` 你的牛子当前长度为 ${lsjj} 厘米喵~`]
e.reply(msg2);
}
}
async toubang(e) {
if (!e.isGroup) {
e.reply("只能在群聊使用呢~");
return;
}
let groupId = e.group_id; // 获取群聊号
let dem = `resources/fuck/${groupId}.txt`
if (!fs.existsSync(dem)) {
fs.writeFileSync(dem,`0`);
console.log(`${groupId}权限文件不存在自动创建 0`)
}
let qx = fs.readFileSync(dem)
console.log(`${groupId}权限为${qx}`)
if (qx == 0 && !e.isMaster ) {
e.reply(`${groupId}还未开启银趴!`);
return;
}
const dirname = `resources/fuck/tou/${e.group_id}/`; // 修改为您的目录
if (!fs.existsSync(dirname)) {
await e.reply('本群还没有被透记录!');
return;
}
const files = fs.readdirSync(dirname);
const txtFiles = files.filter(file => path.extname(file) === '.txt');
let obj = [];
let bbj = []
for (const file of txtFiles) {
const qq = path.basename(file, '.txt');
const content = Number(fs.readFileSync(`${dirname}/${file}`, 'utf-8').trim());
obj.push(qq);
bbj.push(content)
}
// 将头像和内容合并
let res = obj.map((qq, i) => ({
qq,
content: bbj[i]
}));
// 根据内容排序
res.sort((a, b) => b.content - a.content);
console.log(res);
let msgRes = []
for (let i = 0; i < Math.min(res.length, 20); i++) {
const { qq, content } = res[i];
msgRes[i] = [
segment.image(`http://q1.qlogo.cn/g?b=qq&nk=${qq}&s=100`),
`第${i+1}名:${content} mL`
];
}
e.reply(`本群今日被透排行榜如下:`)
await sleep(1000);
await e.reply(await common.makeForwardMsg(e, msgRes));
}
async jjbang(e) {
if (!e.isGroup) {
e.reply("只能在群聊使用呢~");
return;
}
let groupId = e.group_id; // 获取群聊号
let dem = `resources/fuck/${groupId}.txt`
if (!fs.existsSync(dem)) {
fs.writeFileSync(dem,`0`);
console.log(`${groupId}权限文件不存在自动创建 0`)
}
let qx = fs.readFileSync(dem)
console.log(`${groupId}权限为${qx}`)
if (qx == 0 && !e.isMaster ) {
e.reply(`${groupId}还未开启银趴!`);
return;
}
const dirname = `resources/fuck/jj/${e.group_id}/`; // 修改为您的目录
if (!fs.existsSync(dirname)) {
await e.reply('本群还没有牛子记录!');
return;
}
const files = fs.readdirSync(dirname);
const txtFiles = files.filter(file => path.extname(file) === '.txt');
let obj = [];
let bbj = []
for (const file of txtFiles) {
const qq = path.basename(file, '.txt');
const content = Number(fs.readFileSync(`${dirname}/${file}`, 'utf-8').trim());
obj.push(qq);
bbj.push(content)
}
// 将头像和内容合并
let res = obj.map((qq, i) => ({
qq,
content: bbj[i]
}));
// 根据内容排序
res.sort((a, b) => b.content - a.content);
console.log(res);
let msgRes = []
for (let i = 0; i < Math.min(res.length, 20); i++) {
const { qq, content } = res[i];
msgRes[i] = [
segment.image(`http://q1.qlogo.cn/g?b=qq&nk=${qq}&s=100`),
`第${i+1}名:${content} cm`
];
}
e.reply(`本群牛子排行榜如下:`)
await sleep(1000);
await e.reply(await common.makeForwardMsg(e, msgRes));
}
async duodiao(e) {
if (!e.isGroup) {
e.reply("只能在群聊使用呢~");
return;
}
let groupId = e.group_id; // 获取群聊号
let dem = `resources/fuck/${groupId}.txt`
if (!fs.existsSync(dem)) {
fs.writeFileSync(dem,`0`);
console.log(`${groupId}权限文件不存在自动创建 0`)
}
let qx = fs.readFileSync(dem)
console.log(`${groupId}权限为${qx}`)
if (qx == 0 && !e.isMaster ) {
e.reply(`${groupId}还未开启银趴!`);
return;
}
console.log("用户命令:", e.msg);
let uid = e.user_id
let zr = `resources/fuck/jj/${e.group_id}/${uid}.txt`;
if (!fs.existsSync(zr)) {
let msg1 = [`${name} 还没有牛子!`]
e.reply(msg1)
return;
}
fs.unlinkSync(zr)
let msg2 = [
segment.at(uid),
segment.image('https://gchat.qpic.cn/gchatpic_new/746659424/4144974507-2439053290-125E4E51B9D45F2C955E6675AF7C6CEE/0?term=3&is_origin=0')
];
await e.reply(msg2);
}
}
// 延迟执行函数
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
const rule = '55 59 23 * * *';
const job = schedule.scheduleJob(rule, () => {
const folderPath = 'resources/fuck/tou';
fs.readdir(folderPath, (err, files) => {
if (err) throw err;
files.forEach((file) => {
const filePath = path.join(folderPath, file);
if (fs.existsSync(filePath) && fs.statSync(filePath).isDirectory() && /^\d+$/.test(file)) {
fs.rmdirSync(filePath, { recursive: true });
console.log(`今日注射量已清空`);
}
});
});
});
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。