- 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.
22 lines
691 B
TypeScript
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();
|
|
}
|
|
};
|