...
export class UserEvent extends Listener {
private interval: NodeJS.Timeout | null = null;
public override run() {
if (!config.enabled) return;
this.startInterval();
}
public async resetInterval() {
if (this.interval) {
clearInterval(this.interval);
this.startInterval();
}
}
private startInterval() {
this.interval = setInterval(async () => {
this.assignMember();
}, 1000 * 60 * 60);
}
...
...
export class UserEvent extends Listener {
private interval: NodeJS.Timeout | null = null;
public override run() {
if (!config.enabled) return;
this.startInterval();
}
public async resetInterval() {
if (this.interval) {
clearInterval(this.interval);
this.startInterval();
}
}
private startInterval() {
this.interval = setInterval(async () => {
this.assignMember();
}, 1000 * 60 * 60);
}
...