Updated cron
This commit is contained in:
@@ -44,7 +44,7 @@
|
|||||||
"anilist": "^0.12.4",
|
"anilist": "^0.12.4",
|
||||||
"axios": "^1.8.1",
|
"axios": "^1.8.1",
|
||||||
"chalk": "^5.4.1",
|
"chalk": "^5.4.1",
|
||||||
"cron": "^3.5.0",
|
"cron": "^4.1.0",
|
||||||
"discord-player": "^6.7.1",
|
"discord-player": "^6.7.1",
|
||||||
"discord-player-youtubei": "^1.4.2",
|
"discord-player-youtubei": "^1.4.2",
|
||||||
"discord.js": "^14.18.0",
|
"discord.js": "^14.18.0",
|
||||||
|
|||||||
11
pnpm-lock.yaml
generated
11
pnpm-lock.yaml
generated
@@ -38,8 +38,8 @@ importers:
|
|||||||
specifier: ^5.4.1
|
specifier: ^5.4.1
|
||||||
version: 5.4.1
|
version: 5.4.1
|
||||||
cron:
|
cron:
|
||||||
specifier: ^3.5.0
|
specifier: ^4.1.0
|
||||||
version: 3.5.0
|
version: 4.1.0
|
||||||
discord-player:
|
discord-player:
|
||||||
specifier: ^6.7.1
|
specifier: ^6.7.1
|
||||||
version: 6.7.1(@discord-player/extractor@4.5.1(encoding@0.1.13))
|
version: 6.7.1(@discord-player/extractor@4.5.1(encoding@0.1.13))
|
||||||
@@ -1270,8 +1270,9 @@ packages:
|
|||||||
resolution: {integrity: sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==}
|
resolution: {integrity: sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==}
|
||||||
engines: {node: '>= 0.6'}
|
engines: {node: '>= 0.6'}
|
||||||
|
|
||||||
cron@3.5.0:
|
cron@4.1.0:
|
||||||
resolution: {integrity: sha512-0eYZqCnapmxYcV06uktql93wNWdlTmmBFP2iYz+JPVcQqlyFYcn1lFuIk4R54pkOmE7mcldTAPZv6X5XA4Q46A==}
|
resolution: {integrity: sha512-wmcuXr2qP0UZStYgwruG6jC2AYSO9n5VMm2t93hmcEXEjWY3S2bsXe3sfGUrTs/uQ1AvRCrZ0Pp9Q032L/V9tw==}
|
||||||
|
engines: {node: '>=18.x'}
|
||||||
|
|
||||||
cross-spawn@7.0.6:
|
cross-spawn@7.0.6:
|
||||||
resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==}
|
resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==}
|
||||||
@@ -3708,7 +3709,7 @@ snapshots:
|
|||||||
dependencies:
|
dependencies:
|
||||||
safe-buffer: 5.2.1
|
safe-buffer: 5.2.1
|
||||||
|
|
||||||
cron@3.5.0:
|
cron@4.1.0:
|
||||||
dependencies:
|
dependencies:
|
||||||
'@types/luxon': 3.4.2
|
'@types/luxon': 3.4.2
|
||||||
luxon: 3.5.0
|
luxon: 3.5.0
|
||||||
|
|||||||
@@ -11,13 +11,9 @@ export default async function loadCronEvents(ft: FileType) {
|
|||||||
for (const file of cronFiles) {
|
for (const file of cronFiles) {
|
||||||
const filePath = path.join(cronPath, file)
|
const filePath = path.join(cronPath, file)
|
||||||
const { default: cron } = await import("file://" + filePath) as { default: ICron }
|
const { default: cron } = await import("file://" + filePath) as { default: ICron }
|
||||||
|
const { seconds, minutes, hours, dayOfMonth, month, dayOfWeek } = cron.time
|
||||||
|
|
||||||
const time = cron.time.seconds + " " +
|
const time = `${seconds} ${minutes} ${hours} ${dayOfMonth} ${month} ${dayOfWeek}`
|
||||||
cron.time.minutes + " " +
|
|
||||||
cron.time.hours + " " +
|
|
||||||
cron.time.dayOfMonth + " " +
|
|
||||||
cron.time.month + " " +
|
|
||||||
cron.time.dayOfWeek
|
|
||||||
|
|
||||||
new CronJob(time, cron.execute, cron.onComplete, cron.start, cron.timeZone).start()
|
new CronJob(time, cron.execute, cron.onComplete, cron.start, cron.timeZone).start()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user