From 06916ad21ccc0febcff025e0496c7642f60a39e1 Mon Sep 17 00:00:00 2001 From: toast-ts <96593068+toast-ts@users.noreply.github.com> Date: Sun, 29 Jan 2023 09:58:30 +1100 Subject: [PATCH] Idea scrapped. --- package.json | 2 -- src/index.ts | 20 -------------------- 2 files changed, 22 deletions(-) diff --git a/package.json b/package.json index e6ffa45..2e14d69 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,6 @@ "discord.js": "14.7.1", "moment": "2.29.4", "ms": "2.1.3", - "node-cron": "3.0.2", "sequelize": "6.28.0", "sqlite3": "5.1.4", "systeminformation": "5.17.4", @@ -38,7 +37,6 @@ }, "devDependencies": { "@types/node": "18.11.18", - "@types/node-cron": "3.0.7", "ts-node": "10.9.1" } } diff --git a/src/index.ts b/src/index.ts index 7ec1822..d13b8b7 100644 --- a/src/index.ts +++ b/src/index.ts @@ -4,8 +4,6 @@ const client = new TClient; client.init(); import fs from 'node:fs'; import MPDB from './models/MPServer'; -//import cron from 'node-cron'; -//import {exec} from 'node:child_process'; import {Punishment, UserLevels, FSData, FSCareerSavegame} from './typings/interfaces'; client.on('ready', async()=>{ @@ -31,7 +29,6 @@ client.on('ready', async()=>{ }) }, 500000); console.log(`${client.user.tag} has logged into Discord API and now ready for operation`); - //console.log('Total cron tasks: ' + cron.getTasks().size); console.log(client.config.botSwitches); (client.channels.resolve(client.config.mainServer.channels.bot_status) as Discord.TextChannel).send(`${client.user.username} is active\n\`\`\`json\n${Object.entries(client.config.botSwitches).map((hi)=>`${hi[0]}: ${hi[1]}`).join('\n')}\`\`\``); @@ -178,20 +175,3 @@ setInterval(async()=>{ client.guilds.cache.get(client.config.mainServer.id).commands.fetch().then((commands)=>(client.channels.resolve(client.config.mainServer.channels.logs) as Discord.TextChannel).send(`:pencil: Pushed \`[${formattedDate}, ${total}]\` to x.name == 'rank').id}>`)) } }, 5000) - -// Check Windows Updates at 6PM Sydney Time every Tuesday and Thursday -// 0 18 * * 2,4 -/* -cron.schedule('* * * * *', async function(){ - const x = await (client.channels.resolve(client.config.mainServer.channels.thismeanswar) as Discord.TextChannel).send('Checking Windows Updates...') - exec('D:/Bots-Housing/wu.ps1', {'shell':'powershell.exe'}, (err:Error, stdout)=>{ - if (err){ - x.edit('Powershell script caught an error, see console.'); - console.log(err.stack) - } else if (stdout.includes('You\'re up to date')){ - x.edit('The system is up to date.') - } else if (stdout.includes('Updates available')){ - x.edit(`\`\`\`${stdout}\`\`\``) - } - }); -})*/