|
@@ -37,7 +37,7 @@ interface TimedViolationStopHandler {
|
|
|
@Plugin
|
|
|
export class ViolationPlugin {
|
|
|
jobs: Record<number, Job> = {};
|
|
|
- stopHandlers: TimedViolationStopHandler[] = [
|
|
|
+ timedViolationHandlers: TimedViolationStopHandler[] = [
|
|
|
{
|
|
|
command: "mute",
|
|
|
type: Mute,
|
|
@@ -76,7 +76,7 @@ export class ViolationPlugin {
|
|
|
];
|
|
|
|
|
|
async start(): Promise<void> {
|
|
|
- for (const handler of this.stopHandlers) {
|
|
|
+ for (const handler of this.timedViolationHandlers) {
|
|
|
const repo = getRepository(handler.type);
|
|
|
const validViolations = await repo.find({
|
|
|
where: { valid: true }
|
|
@@ -112,7 +112,7 @@ export class ViolationPlugin {
|
|
|
if (!hasActiveViolations)
|
|
|
return;
|
|
|
|
|
|
- for (const handler of this.stopHandlers) {
|
|
|
+ for (const handler of this.timedViolationHandlers) {
|
|
|
const repo = getRepository(handler.type);
|
|
|
const activeViolations = await repo.find({
|
|
|
where: {
|
|
@@ -155,7 +155,7 @@ export class ViolationPlugin {
|
|
|
}
|
|
|
|
|
|
private getViolationHandler(type: ObjectType<TimedViolation>): TimedViolationStopHandler {
|
|
|
- for (const handler of this.stopHandlers) {
|
|
|
+ for (const handler of this.timedViolationHandlers) {
|
|
|
if (handler.type == type)
|
|
|
return handler;
|
|
|
}
|