Files
discord-rpg-concept/bot/modules/system/scheduler.ts
syntaxbullet 58374d1746 refactor: migrate all code to use getGuildConfig() for guild settings
- Update all commands and events to fetch guild config once per execution
- Pass config to service methods that need it (ModerationService.issueWarning)
- Update terminal service to use guildSettingsService for persistence
- Remove direct imports of config for guild-specific settings

This consolidates configuration to database-backed guild settings,
eliminating the dual config system.
2026-02-12 16:09:37 +01:00

22 lines
691 B
TypeScript

import { temporaryRoleService } from "@shared/modules/system/temp-role.service";
import { terminalService } from "@shared/modules/terminal/terminal.service";
export const schedulerService = {
start: () => {
console.log("🕒 Scheduler started: Maintenance loops initialized.");
// 1. Temporary Role Revocation (every 60s)
setInterval(() => {
temporaryRoleService.processExpiredRoles();
}, 60 * 1000);
// 2. Terminal Update Loop (every 60s)
setInterval(() => {
terminalService.update();
}, 60 * 1000);
// Run an initial check on start
temporaryRoleService.processExpiredRoles();
}
};