ソースを参照

Refactor stopHandlers to timedViolationHandlers

ghorsington 4 年 前
コミット
5cfe08c60d
1 ファイル変更4 行追加4 行削除
  1. 4 4
      bot/src/plugins/violation.ts

+ 4 - 4
bot/src/plugins/violation.ts

@@ -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;
         }