itizawa 4 lat temu
rodzic
commit
1a6c093b7d
1 zmienionych plików z 4 dodań i 2 usunięć
  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) => {
       const isSupported = await this.relationsService.isSupportedGrowiCommandForBroadcastUse(relation, growiCommand.growiCommandType, baseDate);
       if (isSupported) {
-        relationsForSingleUse.push(relation);
+        relationsForBroadcastUse.push(relation);
       }
     }));
 
     /*
      * forward to GROWI server
      */
-    this.sendCommand(growiCommand, relationsForBroadcastUse, body);
+    if (relationsForBroadcastUse.length > 0) {
+      this.sendCommand(growiCommand, relationsForBroadcastUse, body);
+    }
   }
 
   @Post('/interactions')