From 8feb6b91f4ef390d063895eca572ca21b8631e68 Mon Sep 17 00:00:00 2001 From: WubzyGD Date: Fri, 7 May 2021 19:31:27 -0600 Subject: [PATCH] cron test --- commands/utility/remind.js | 21 +++++++++++++++++++++ package-lock.json | 36 ++++++++++++++++++++++++++++++++++++ package.json | 1 + 3 files changed, 58 insertions(+) create mode 100644 commands/utility/remind.js diff --git a/commands/utility/remind.js b/commands/utility/remind.js new file mode 100644 index 0000000..0910c8e --- /dev/null +++ b/commands/utility/remind.js @@ -0,0 +1,21 @@ +const Discord = require('discord.js'); +const cron = require('cron'); + +module.exports = { + name: "remind", + aliases: ['remindme', 'reminder'], + meta: { + category: 'Utility', + description: "", + syntax: '` <>`', + extra: null + }, + help: new Discord.MessageEmbed() + .setTitle("Help -> ") + .setDescription("") + .addField("Syntax", "``"), + async execute(message, msg, args, cmd, prefix, mention, client) { + //if (!args.length) {return message.channel.send(`Syntax: \`${prefix}\``);} + const job = new cron.CronJob(new Date().setMinutes(new Date().getMinutes() + 1), () => message.author.send('test cron')); + } +}; \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 48ae498..17fc368 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,7 @@ "dependencies": { "canvas": "^2.6.1", "chalk": "^4.1.0", + "cron": "^1.8.2", "dblapi.js": "^2.4.1", "discord.io": "https://github.com/woor/discord.io/tarball/gateway_v6", "discord.js": "^12.2.0", @@ -384,6 +385,14 @@ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" }, + "node_modules/cron": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/cron/-/cron-1.8.2.tgz", + "integrity": "sha512-Gk2c4y6xKEO8FSAUTklqtfSr7oTq0CiPQeLBG5Fl0qoXpZyMcj1SG59YL+hqq04bu6/IuEA7lMkYDAplQNKkyg==", + "dependencies": { + "moment-timezone": "^0.5.x" + } + }, "node_modules/dblapi.js": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/dblapi.js/-/dblapi.js-2.4.1.tgz", @@ -832,6 +841,17 @@ "moment": ">=2.9.0" } }, + "node_modules/moment-timezone": { + "version": "0.5.33", + "resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.33.tgz", + "integrity": "sha512-PTc2vcT8K9J5/9rDEPe5czSIKgLoGsH8UNpA4qZTVw0Vd/Uz19geE9abbIOQKaAQFcnQ3v5YEXrbSc5BpshH+w==", + "dependencies": { + "moment": ">= 2.9.0" + }, + "engines": { + "node": "*" + } + }, "node_modules/mongodb": { "version": "3.6.4", "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.6.4.tgz", @@ -1918,6 +1938,14 @@ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" }, + "cron": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/cron/-/cron-1.8.2.tgz", + "integrity": "sha512-Gk2c4y6xKEO8FSAUTklqtfSr7oTq0CiPQeLBG5Fl0qoXpZyMcj1SG59YL+hqq04bu6/IuEA7lMkYDAplQNKkyg==", + "requires": { + "moment-timezone": "^0.5.x" + } + }, "dblapi.js": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/dblapi.js/-/dblapi.js-2.4.1.tgz", @@ -2281,6 +2309,14 @@ "integrity": "sha1-YKwHX9/RRon20QKvdR0XGoC0q2A=", "requires": {} }, + "moment-timezone": { + "version": "0.5.33", + "resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.33.tgz", + "integrity": "sha512-PTc2vcT8K9J5/9rDEPe5czSIKgLoGsH8UNpA4qZTVw0Vd/Uz19geE9abbIOQKaAQFcnQ3v5YEXrbSc5BpshH+w==", + "requires": { + "moment": ">= 2.9.0" + } + }, "mongodb": { "version": "3.6.4", "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.6.4.tgz", diff --git a/package.json b/package.json index a1230db..9702a81 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "dependencies": { "canvas": "^2.6.1", "chalk": "^4.1.0", + "cron": "^1.8.2", "dblapi.js": "^2.4.1", "discord.io": "https://github.com/woor/discord.io/tarball/gateway_v6", "discord.js": "^12.2.0",