@kingsworld/plugin-cron
Version:
A simple @sapphire/framework plugin that aims to make use of the croner package and allow users to make cron jobs within their Sapphire discord bot.
39 lines (36 loc) • 1.67 kB
JavaScript
;
var __defProp = Object.defineProperty;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
// src/lib/CronTaskHandler.ts
var _CronTaskHandler = class _CronTaskHandler {
constructor(options) {
/**
* The default IANA/TZ timezone to use for all cron jobs.
* You can override this per task, using the timezone option.
* @see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
*/
__publicField(this, "defaultTimezone");
/**
* The ability to opt-out of instrumenting cron jobs with Sentry.
* If you don't use Sentry, you can ignore this option.
* @see https://docs.sentry.io/product/crons/
* @default false
*/
__publicField(this, "disableSentry");
/**
* The Sentry instance to use for instrumenting cron jobs.
* This is only available when [`@sentry/node`](https://www.npmjs.com/package/@sentry/node)
* is installed and the {@linkcode disableSentry} option is set to false.
*/
__publicField(this, "sentry");
this.defaultTimezone = options?.defaultTimezone;
this.disableSentry = options?.disableSentry ?? false;
}
};
__name(_CronTaskHandler, "CronTaskHandler");
var CronTaskHandler = _CronTaskHandler;
exports.CronTaskHandler = CronTaskHandler;
//# sourceMappingURL=CronTaskHandler.cjs.map
//# sourceMappingURL=CronTaskHandler.cjs.map