itizawa преди 4 години
родител
ревизия
1a6c093b7d
променени са 1 файла, в които са добавени 4 реда и са изтрити 2 реда
  1. 4 2
      packages/slackbot-proxy/src/controllers/slack.ts

+ 4 - 2
packages/slackbot-proxy/src/controllers/slack.ts

@@ -182,14 +182,16 @@ export class SlackCtrl {
     await Promise.all(relations.map(async(relation) => {
     await Promise.all(relations.map(async(relation) => {
       const isSupported = await this.relationsService.isSupportedGrowiCommandForBroadcastUse(relation, growiCommand.growiCommandType, baseDate);
       const isSupported = await this.relationsService.isSupportedGrowiCommandForBroadcastUse(relation, growiCommand.growiCommandType, baseDate);
       if (isSupported) {
       if (isSupported) {
-        relationsForSingleUse.push(relation);
+        relationsForBroadcastUse.push(relation);
       }
       }
     }));
     }));
 
 
     /*
     /*
      * forward to GROWI server
      * forward to GROWI server
      */
      */
-    this.sendCommand(growiCommand, relationsForBroadcastUse, body);
+    if (relationsForBroadcastUse.length > 0) {
+      this.sendCommand(growiCommand, relationsForBroadcastUse, body);
+    }
   }
   }
 
 
   @Post('/interactions')
   @Post('/interactions')