From 5562abe0c964acaab2c1353559f7d36018affdd6 Mon Sep 17 00:00:00 2001 From: toast-ts <96593068+toast-ts@users.noreply.github.com> Date: Fri, 26 Apr 2024 20:44:00 +1000 Subject: [PATCH] Yarn.lock maintenance --- package.json | 2 +- src/commands/dev.ts | 2 ++ src/index.ts | 4 ++-- yarn.lock | 10 +++++----- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 1f3b7df..7a2a0c1 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "@octokit/rest": "20.1.0", "@sequelize/core": "7.0.0-alpha.40", "@sequelize/postgres": "7.0.0-alpha.40", - "@toast/tokenservice-client": "1.2.6", + "@toast/tokenservice-client": "1.2.7", "ansi-colors": "4.1.3", "dayjs": "1.11.10", "discord.js": "14.14.1", diff --git a/src/commands/dev.ts b/src/commands/dev.ts index 6b46563..12fdb94 100644 --- a/src/commands/dev.ts +++ b/src/commands/dev.ts @@ -6,6 +6,7 @@ import UsernameHelper from '../helpers/UsernameHelper.js'; import Formatters from '../helpers/Formatters.js'; import GitHub from '../helpers/GitHub.js'; import TClient from '../client.js'; +import cron from 'node-cron'; import util from 'node:util'; import fs from 'node:fs'; export default class Developer { @@ -14,6 +15,7 @@ export default class Developer { ({ eval: async()=>{ fs; + cron; DatabaseServer; const code = interaction.options.getString('code') as string; diff --git a/src/index.ts b/src/index.ts index 8e1d016..5fa49fc 100644 --- a/src/index.ts +++ b/src/index.ts @@ -27,13 +27,13 @@ if ((typeof process.argv[4] === 'string' && process.argv[4] === 'true') ?? null) // Interval timers for modules setInterval(async()=>await MPModule(client), refreshTimerSecs); cron.schedule('0-5 * * * *', ()=>YTModule(client)); // Every minute from 0 through 5 -cron.schedule('5-25 * * * *', async()=>{// Every minute from 5 through 25 +cron.schedule('5-12 * * * *', async()=>{// Every minute from 5 through 12 const forum = client.guilds.cache.get(client.config.dcServer.id).channels.cache.get(client.config.dcServer.channels.help_forum) as Discord.ForumChannel; await forum.threads.fetch(); for await (const thread of forum.threads.cache.values()) { await thread.messages.fetch(); - if (!thread.archived && thread.lastMessage.createdTimestamp <= Date.now() - 1555200000) {// check if thread is inactive for over 18 days + if ((!thread.locked || !thread.archived) && thread.lastMessage.createdTimestamp <= Date.now() - 1555200000) {// check if thread is inactive for over 18 days await thread.delete(); Logger.console('log', 'ThreadTimer', `"#${thread.name}" has been deleted due to inactivity for 18 days`); } diff --git a/yarn.lock b/yarn.lock index ae161e5..5e324ab 100644 --- a/yarn.lock +++ b/yarn.lock @@ -524,12 +524,12 @@ __metadata: languageName: node linkType: hard -"@toast/tokenservice-client@npm:1.2.6": - version: 1.2.6 - resolution: "@toast/tokenservice-client@npm:1.2.6::__archiveUrl=https%3A%2F%2Fgit.toast-server.net%2Fapi%2Fpackages%2Ftoast%2Fnpm%2F%2540toast%252Ftokenservice-client%2F-%2F1.2.6%2Ftokenservice-client-1.2.6.tgz" +"@toast/tokenservice-client@npm:1.2.7": + version: 1.2.7 + resolution: "@toast/tokenservice-client@npm:1.2.7::__archiveUrl=https%3A%2F%2Fgit.toast-server.net%2Fapi%2Fpackages%2Ftoast%2Fnpm%2F%2540toast%252Ftokenservice-client%2F-%2F1.2.7%2Ftokenservice-client-1.2.7.tgz" dependencies: undici: "npm:6.14.1" - checksum: 10/eabaacd8982d936e2d0b50ddc7bb5d19859c5fe345b86cb130e032f3d5e159b0d7760f7fea034b9a00dc202de0494e57bab228738a7240a13b501d207509db00 + checksum: 10/e46cb44500acf96366aed1deeea76a1c66ff7184ec32b8b2f9b92f417f67f3542f4c1a478d036ce09fb7fb33286361869f60c44c19dca55d21c2e11239de3d5c languageName: node linkType: hard @@ -702,7 +702,7 @@ __metadata: "@octokit/rest": "npm:20.1.0" "@sequelize/core": "npm:7.0.0-alpha.40" "@sequelize/postgres": "npm:7.0.0-alpha.40" - "@toast/tokenservice-client": "npm:1.2.6" + "@toast/tokenservice-client": "npm:1.2.7" "@types/ms": "npm:0.7.34" "@types/node": "npm:20.12.7" "@types/node-cron": "npm:3.0.11"