UNPKG

@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.

64 lines (62 loc) 2.42 kB
import { __name } from '../../chunk-2JTKI4GS.mjs'; import { Piece } from '@sapphire/pieces'; var _CronTask = class _CronTask extends Piece { constructor(context, options) { super(context, options); } /** * A helper function to log messages with the `CronTask[${name}]` prefix. * @param message The message to include after the prefix * @param other Extra parameters to pass to the logger * @example * this.info('Hello world!'); // CronTask[my-task] Hello world! */ info(message, ...other) { this.container.logger.info(`CronTask[${this.name}] ${message}`, ...other); } /** * A helper function to log messages with the `CronTask[${name}]` prefix. * @param message The message to include after the prefix * @param other Extra parameters to pass to the logger * @example * this.error('Something went wrong!'); // CronTask[my-task] Something went wrong! */ error(message, ...other) { this.container.logger.error(`CronTask[${this.name}] ${message}`, ...other); } /** * A helper function to log messages with the `CronTask[${name}]` prefix. * @param message The message to include after the prefix * @param other Extra parameters to pass to the logger * @example * this.warn('Something is not right!'); // CronTask[my-task] Something is not right! */ warn(message, ...other) { this.container.logger.warn(`CronTask[${this.name}] ${message}`, ...other); } /** * A helper function to log messages with the `CronTask[${name}]` prefix. * @param message The message to include after the prefix * @param other Extra parameters to pass to the logger * @example * this.debug('Something is happening!'); // CronTask[my-task] Something is happening! */ debug(message, ...other) { this.container.logger.debug(`CronTask[${this.name}] ${message}`, ...other); } /** * A helper function to log messages with the `CronTask[${name}]` prefix. * @param message The message to include after the prefix * @param other Extra parameters to pass to the logger * @example * this.trace('Loaded the file.'); // CronTask[my-task] Loaded the file. */ trace(message, ...other) { this.container.logger.trace(`CronTask[${this.name}] ${message}`, ...other); } }; __name(_CronTask, "CronTask"); var CronTask = _CronTask; export { CronTask }; //# sourceMappingURL=CronTask.mjs.map //# sourceMappingURL=CronTask.mjs.map