djs-core provides structured ways and background tasks, keeping your bot logic modular and easy to manage.
Cron tasks allow you to run code at specific intervals. This is useful for cleanup, daily messages, or background processing.
Experimental Feature: To use cron tasks, you must enable them in your
djs.config.ts.[djs.config.ts]
src/cron/.
[src/cron/hourly-cleanup.ts]
Key Methods
.cron("expression"): A standard cron expression (e.g.,* * * * *for every minute)..run((client) => { ... }): The code to execute when the task runs.