Explorar o código

add body.text == null

zahmis %!s(int64=5) %!d(string=hai) anos
pai
achega
8d12e67bd5
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      packages/slackbot-proxy/src/controllers/slack.ts

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

@@ -79,6 +79,10 @@ export class SlackCtrl {
     // Send response immediately to avoid opelation_timeout error
     // See https://api.slack.com/apis/connections/events-api#the-events-api__responding-to-events
 
+    if (body.text == null) {
+      return 'No text.';
+    }
+
     const parsedBody = parseSlashCommand(body);
     const executeGrowiCommand = this.growiCommandsMappings[parsedBody.growiCommandType];
     await executeGrowiCommand(body);