feat(services): implement periodic booster role cleanup
Add a new `boostCleanupService` to periodically scan guilds and remove custom booster roles and database records for members who are no longer eligible (e.g., lost boost status or left the server). This ensures data consistency even if the bot was offline during status changes. - Implement `startBoostCleanup` with configurable intervals - Add `findByGuild` to `BoosterRoleStore` for batch processing - Update `DrizzleBoosterRoleStore` to support guild-based lookups - Add configuration for `boostCleanupIntervalMs`
This commit is contained in:
@@ -22,6 +22,7 @@ export type BoosterRoleRecord = {
|
||||
|
||||
export type BoosterRoleStore = {
|
||||
findByUser(guildId: string, userId: string): Promise<BoosterRoleRecord | null>;
|
||||
findByGuild(guildId: string): Promise<BoosterRoleRecord[]>;
|
||||
create(record: BoosterRoleRecord): Promise<void>;
|
||||
delete(guildId: string, userId: string): Promise<void>;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user